|
|
A359342
|
|
Least pandigital square with n digits.
|
|
2
|
|
|
1026753849, 10057482369, 100549873216, 1000574082369, 10000938205476, 100005740082369, 1000000973875264, 10000057400082369, 100000030347218596, 1000000574000082369, 10000000365759287524, 100000005740000082369, 1000000003751486308921, 10000000057400000082369
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
10,1
|
|
COMMENTS
|
Pandigital squares are perfect squares containing each digit from 0 to 9 at least once.
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.
|
|
LINKS
|
|
|
FORMULA
|
a(n) = 10^(n-1) + 574*10^((n-1)/2) + 82369 for n >= 11 odd.
|
|
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);
|
|
PROG
|
(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)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|