This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A364089 #16 Jul 20 2024 10:53:48 %S A364089 1,1,3,4,5,8,5,10,29,19,19,19,16,18,7,43,41,37,45,39,55,33,43,60,35, %T A364089 61,56,50,44,69,9,64,44,80,43,88,53,71,56,68,59,78,76,74,95,109,111, %U A364089 81,86,136,117,75,98,83,84,99,104,116,95,118,60,81,11,119,119,172,140,97,105,113,93,122,92 %N A364089 a(n) is the greatest k such that the base-n digits of 2^k are all distinct. %C A364089 a(n) <= log_2(A062813(n)). %e A364089 a(10) = 29 because all decimal digits of 2^29 = 536870912 are distinct. %p A364089 f:= proc(b) local M,k,L; %p A364089 M:= b^b - (b^b-b)/(b-1)^2; %p A364089 for k from ilog2(M) to 1 by -1 do %p A364089 L:= convert(2^k,base,b); %p A364089 if nops(L) = nops(convert(L,set)) then return k fi %p A364089 od %p A364089 end proc: %p A364089 map(f, [$2..100]); %o A364089 (Python) %o A364089 from sympy.ntheory.factor_ import digits %o A364089 def A364089(n): %o A364089 m = 1<<(l:=((r:=n**n)-(r-n)//(n-1)**2).bit_length()-1) %o A364089 while len(d:=digits(m,n)[1:]) > len(set(d)): %o A364089 l -= 1 %o A364089 m >>= 1 %o A364089 return l # _Chai Wah Wu_, Jul 07 2023 %Y A364089 Cf. A004642, A004643, A000866, A004645, A004646, A004647, A001357, A000079, A364049. %K A364089 nonn,base %O A364089 2,3 %A A364089 _Robert Israel_, Jul 04 2023