A359342 Least pandigital square with n digits.
1026753849, 10057482369, 100549873216, 1000574082369, 10000938205476, 100005740082369, 1000000973875264, 10000057400082369, 100000030347218596, 1000000574000082369, 10000000365759287524, 100000005740000082369, 1000000003751486308921, 10000000057400000082369
Offset: 10
Programs
-
Maple
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: seq(a(n),n=10..30);
-
Python
from math import isqrt def c(n): return len(set(str(n))) == 10 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) print([a(n) for n in range(10, 24)]) # Michael S. Branicky, Dec 27 2022
Formula
a(n) = 10^(n-1) + 574*10^((n-1)/2) + 82369 for n >= 11 odd.
Comments