OFFSET
2,1
COMMENTS
At most 2 of the n squares are not divisible by 9.
EXAMPLE
a(5) = 181919 because it is the concatenation of five squares 1^2 = 1, 9^2 = 81, 3^2 = 9, 1^2 = 1 and 3^2 = 9, and 19, 919, 81919 and 181919 are all prime, and this is the least number that works.
MAPLE
for d from 1 to 8 do
m1:= ceil(10^((d-1)/2));
m2:= floor(sqrt(10^d - 1));
S[d]:= {seq(i^2, i=m1..m2)};
if m1::even then m1:= m1+1 fi;
So[d]:= {seq(i^2, i=m1..m2, 2)};
od:
for d from 2 to 9 do P[2, d]:= select(isprime, {seq(seq(seq(10^i*s+t, t=So[i]), s=S[d-i]), i=1..d-1)}) od:
L[2]:= 11:
mm[2]:= 2:
for m from 3 do
found:= false;
for d from mm[m-1]+1 to m+7 do
P[m, d]:= select(isprime, {seq(seq(seq(10^i*s+t, t=P[m-1, i]), s=S[d-i]), i=mm[m-1]..d-1)});
if P[m, d] <> {} and not found then mm[m]:= d; found:= true: L[m]:= min(P[m, d]) fi;
od;
if not found then break fi;
od:
seq(L[i], i=2..m-1);
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Oct 20 2023
STATUS
approved