In base 10, the number 3816547290 contains every digit **exactly once**. When I take the first N digits, that substring is divisible by N. For example, 381 is divisible by 3, 38165 is divisible by 5, etc. In base 10, 3816547290 is the only such number which meets the above criteria.


My question is, how can I find these numbers for any given base? I made a program to search for them up to base 30. Out of all the bases it tried, it only found numbers for bases 2, 4, 6, 8, 10, and 14. These numbers where as follows (I use digits 0-9 and A-D):



```
base 2 - 10
base 4 - 1230
base 4 - 3210
base 6 - 143250
base 6 - 543210
base 8 - 32541670
base 8 - 52347610
base 8 - 56743210
base 10 - 3816547290
base 14 - 9C3A5476B812D0

```

I do not know if any such numbers exist in bases larger than 14. Even if such numbers do exist, I don't know how to find them. Can anybody think of a general algorithm for finding such numbers or a general proof that they do not exist?


**UPDATE**: my code to find said numbers can be found [on Github](https://github.com/unixpickle/DigitOrder) if anybody wants to look at it. Essentially, the program uses recursion to try all permutations of the digits. If it explores a set of digits which themselves do not meet the criterion, it can stop searching for permutations with that prefix (i.e. if it got to 382 in base 10, it would realize that that number is not divisible by 3 and would thus not search anymore numbers which start with 382).



Numbers with all N-digit prefixes divisible by N
This seems to be a difficult question. <https://oeis.org/A111456> is "Pandigitals in some base with an extra property: each number formed by the first $i$ digits is divisible by $i$ (digits in the pandigital base)." A comment there says, "Finite? There are no more terms up to base 40. A probabilistic argument says higher bases are increasingly unlikely to produce a value." <https://oeis.org/A181736> tracks the same problem and a comment says it can't happen when the base is of the form $2m(2m-1)$ with $m>1$. 


