OFFSET
2,3
COMMENTS
a(n) <= log_2(A062813(n)).
EXAMPLE
a(10) = 29 because all decimal digits of 2^29 = 536870912 are distinct.
MAPLE
f:= proc(b) local M, k, L;
M:= b^b - (b^b-b)/(b-1)^2;
for k from ilog2(M) to 1 by -1 do
L:= convert(2^k, base, b);
if nops(L) = nops(convert(L, set)) then return k fi
od
end proc:
map(f, [$2..100]);
PROG
(Python)
from sympy.ntheory.factor_ import digits
def A364089(n):
m = 1<<(l:=((r:=n**n)-(r-n)//(n-1)**2).bit_length()-1)
while len(d:=digits(m, n)[1:]) > len(set(d)):
l -= 1
m >>= 1
return l # Chai Wah Wu, Jul 07 2023
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Jul 04 2023
STATUS
approved