cp's OEIS Frontend

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.

A359341 Number of pandigital squares with n digits.

This page as a plain text file.
%I A359341 #10 Dec 31 2022 02:12:22
%S A359341 0,0,0,0,0,0,0,0,0,87,504,4275,29433,179235,955818,4653802,21034628,
%T A359341 89834238,366490378,1440743933,5493453262
%N A359341 Number of pandigital squares with n digits.
%C A359341 Pandigital squares are perfect squares containing each digit from 0 to 9 at least once.
%e A359341 a(n) = 0 for n < 10, since a number must have at least ten digits to contain all digits from 0 to 9 at least once.
%e A359341 a(10) = 87 since there are 87 ten-digit pandigital squares from 1026753849 to 9814072356 (cf. A036745) containing each digit from 0 to 9, here exactly once.
%p A359341 a:=proc(n::posint) local p,k,K: if n<10 then p:=0; else p:=0: for k from ceil(sqrt(10^(n-1))) to floor(sqrt(10^n)) do K:=convert(k^2,base,10); if nops({op(K)})=10 then p:=p+1: fi: od: fi: return p; end:
%o A359341 (Python)
%o A359341 from math import isqrt
%o A359341 def c(n): return len(set(str(n))) == 10
%o A359341 def a(n):
%o A359341     lb = isqrt(10**(n-1)) if n&1 else isqrt(10**(n-1)) + 1
%o A359341     return sum(1 for k in range(lb, isqrt(10**n-1)+1) if c(k*k))
%o A359341 print([a(n) for n in range(1, 14)]) # _Michael S. Branicky_, Dec 27 2022
%Y A359341 Cf. A036745, A225218.
%K A359341 nonn,base
%O A359341 1,10
%A A359341 _Martin Renner_, Dec 27 2022
%E A359341 a(19)-a(21) from _Michael S. Branicky_, Dec 27 2022