OFFSET
2,2
COMMENTS
Note that this definition precludes the digit 0 appearing anywhere in the base n representation of the number.
REFERENCES
"Enigma 1343: Digital Dividend", New Scientist, Jun 04 2005, p. 28.
LINKS
Jes Wolfe, Table of n, a(n) for n = 2..48
Michael S. Branicky, Python program
Jes Wolfe, Even faster python program
EXAMPLE
a(2) = 1 trivially because that is the only number in base 2 that does not contain 0.
a(4) = 54 because in base 4, 54 is 312_4. There is only one number containing different digits and no zeros higher than that, namely 321_4, but 321_4 is not divisible by 2.
PROG
(Python) # see link for a faster version
from itertools import permutations
def fromdigits(d, b):
n = 0
for di in d: n *= b; n += di
return n
def a(n):
for digits in range(n-1, 0, -1):
for p in permutations(range(n-1, 0, -1), r=digits):
t = fromdigits(p, n)
if all(t%di == 0 for di in p):
return t
print([a(n) for n in range(2, 11)]) # Michael S. Branicky, Jan 17 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Peter Boothe, Jan 03 2006
EXTENSIONS
a(11)-a(13) from Francis Carr (fcarr(AT)alum.mit.edu), Feb 08 2006
a(14) from Michael S. Branicky, Jan 17 2022
a(15)-a(17) from Michael S. Branicky, Jan 20 2022
a(18)-a(21) from Jes Wolfe, Apr 26 2024
STATUS
approved