OFFSET
1,11
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(11)=4 because it is written as 111111111111 in base 1, 1011 in base 2, 102 in base 3 and 23 in base 4; 11 is divisible by 1 but not by 2 or 3
MAPLE
f:= proc(n) local b, L;
for b from 3 to n-2 do
L:= convert(convert(n, base, b), set) minus {0};
if andmap(d -> n mod d <> 0, L) then return b fi
od;
0
end proc:
map(f, [$1..100]); # Robert Israel, Oct 29 2024
PROG
(Python)
from sympy.ntheory import digits
def a(n): return next((b for b in range(3, n-2) if not any(n%d==0 for d in digits(n, b)[1:] if d > 0)), 0)
print([a(n) for n in range(1, 91)]) # Michael S. Branicky, Oct 29 2024
CROSSREFS
KEYWORD
AUTHOR
Henry Bottomley, May 04 2000
STATUS
approved