OFFSET
1,4
REFERENCES
"Enigma 1343: Digital Dividend", New Scientist, Jun 04 2005, 28.
LINKS
Enigmatic Code, Enigma 1343: Digital Dividend, from New Scientist, Jun 04 2005, 28.
EXAMPLE
There are 49 numbers whose base-4 representation does not contain repeated digits. Of these, the largest which is not divisible by any of its digits is a(4) = 203_4 = 35_10.
Any base-3 number containing only 0's and 2's with at least one 2 is divisible by 2, while any number with a 1 is divisible by 1, so no positive integer meets the criteria in base 3. Thus a(3) = 0.
PROG
(SageMath)
def A114342(n):
dd = [0] + [2..n-1]
for width in [1..n-1][::-1]:
found = []
for dc in Combinations(dd, width):
m = sum(dc) % (n-1)
if gcd(m, n-1) in dc: continue # rule of nines
for p in Permutations(dc[::-1]):
s = sum((d)*n**i for i, d in enumerate(p[::-1]))
if not any(d != 0 and s % d == 0 for d in p): found.append(s)
if found and width == len(dd): return s
if found and s < max(found): break
if found: return max(found)
return 0 # D. S. McNeil, Oct 01 2011
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Francis Carr (fcarr(AT)alum.mit.edu), Feb 08 2006
EXTENSIONS
a(12)-a(20) from Nathaniel Johnston, Sep 30 2011
STATUS
approved
