Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #37 Oct 31 2024 10:41:07
%S 2,2,7,7,21,42,71,268,611,1352,3099,8471,23877,63564,182771,527001,
%T 1671752,5055853
%N a(n) is the number of squares that have all digits distinct in base n.
%e a(4) = 7 because the only squares with distinct digits in base 4 are 0^2 = 0_4, 1^2 = 1_4, 2^2 = 10_4, 3^2 = 21_4, 6^2 = 210_4, 7^2 = 301_4 and 15^2 = 3201_4.
%p f:= proc(b) local k,t,F;
%p t:= 0;
%p for k from 0 to floor(sqrt(b^b-1)) do
%p F:= convert(k^2, base, b);
%p if nops(F) = nops(convert(F,set)) then t:= t+1 fi;
%p od;
%p t
%p end proc:
%p map(f, [$2..12]);
%o (Python)
%o from math import isqrt
%o from sympy.ntheory import digits
%o def A376814(n): return sum(1 for k in range(isqrt(n**n-1)+1) if len(s:=digits(k**2,n)[1:])==len(set(s))) # _Chai Wah Wu_, Oct 09 2024
%Y Cf. A119509, A376897.
%K nonn,base,more
%O 2,1
%A _Robert Israel_, Oct 09 2024
%E a(15)-a(16) from _Michael S. Branicky_, Oct 09 2024
%E a(17) from _Michael S. Branicky_, Oct 10 2024
%E a(18) from _Michael S. Branicky_, Oct 14 2024
%E a(19) from _Michael S. Branicky_, Oct 31 2024