so, when my head starts to hurt from working on computer things that aren't fun, i've gotten in the habit of switching over to doing things with the computers that

*are* fun, rather than just filling with hate and bile for the machines. So I've been working on calculating

**pmb**'s number

series (

A113028). It's the sort of problem where you can get a few answers without much work, but the difficulty of each number in the sequence escalates pretty fast.

So I unexpectedly solved base 16 yesterday, and I called Peter immediately. Peter has encouraged me to talk about my latest method- the one that produced Base 16's answer (0xfedcb59726a1348). Well, I think it's base 16's answer- it's hard to prove! (Base 17 just gave me one that was visibly wrong. Hrm. One of my computers is lying.)

Anyway, there's three rules that all are in play to find the right number.

- Answers must be as big as possible
- Answers must not repeat digits or contain zeros
- Answers must be divisible by all of their digits

Well, these distill down to:

- Start at the top, n
^{n-1} is the approximation of that I use, but rules 2 and 3 make it a bit lower in reality - Answers must be contained in the series of lexicographic permutations of digits (321, 312, 231, 213, 132...)
- Answers must be a multiple of the Least Common Multiple of the digits they are made of

So, most of the time, the best way to find an answer is to start at the multiple of the LCM nearest n

^{n-1}, and just subtract the LCM over and over and test to whether it has repeated digits or zeros. But once we reach base 6, there are these huge regions of numbers where the lexicographic permutations are much further apart than the multiples of the LCM are. For example, in base 8, 6712345

_{8} and 6574321

_{8} are adjacent lexicographically, but there are 46 multiples of the LCM between them. As the bases get higher, the gains you get by skipping such ranges get larger, quickly.