%I #12 Dec 31 2022 02:12:45
%S 1026753849,10057482369,100549873216,1000574082369,10000938205476,
%T 100005740082369,1000000973875264,10000057400082369,
%U 100000030347218596,1000000574000082369,10000000365759287524,100000005740000082369,1000000003751486308921,10000000057400000082369
%N Least pandigital square with n digits.
%C Pandigital squares are perfect squares containing each digit from 0 to 9 at least once.
%C For number of digits n >= 11, every second term is of the form 10...05740...082369 with (n-1)/2 - 3 zeros after the leading 1 and (n-1)/2 - 5 zeros after the middle three digits 547. This term is 10...0287^2 with (n-1)/2 - 3 zeros after the leading 1. This is the case since (10^m + 287)^2 = 10^(2*m) + 574*10^m + 82369 with m = (n-1)/2 and n >= 11 odd, and is the first n-digit square containing all digits from 0 to 9.
%F a(n) = 10^(n-1) + 574*10^((n-1)/2) + 82369 for n >= 11 odd.
%p a:=proc(n::posint) local s, k, K: if n<10 then s:=NULL: else 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 s:=k^2: break: fi: od: fi: return s; end:
%p seq(a(n),n=10..30);
%o (Python)
%o from math import isqrt
%o def c(n): return len(set(str(n))) == 10
%o def a(n): return next((k*k for k in range(isqrt(10**(n-1))+1, isqrt(10**n-1)+1) if c(k*k)), None)
%o print([a(n) for n in range(10, 24)]) # _Michael S. Branicky_, Dec 27 2022
%Y Cf. A225218, A359343, A359344.
%K nonn,base
%O 10,1
%A _Martin Renner_, Dec 27 2022
|