OFFSET
1,2
COMMENTS
If n^2 has k digits, there are (k-1) places where digit insertion takes place, and a(n) contains at least 2k-1 digits.
PROG
(PARI) { a(n) = m=Vec(Str(n^2)); r=0; k=#m-1; while(!r, forvec(w=vector(#m-2, i, [1, k-1]), v=vector(#w+1, i, if(i<=#w, w[i], k)-if(i>1, w[i-1])); forvec(u=vector(#v, i, [0, 10^v[i]-1]), t=m[1]; for(i=1, #v, if(#Str(u[i])<v[i], t=concat(t, concat(vector(v[i]-#Str(u[i]), j, "0"))); ); t=concat([t, Str(u[i]), m[i+1]]); ); t=eval(t); if( issquare(t) && (r==0 || t<r), r=t); ); , 2); k++; ); r } \\ Max Alekseyev, Feb 11 2012
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Feb 21 2003
EXTENSIONS
More terms from Max Alekseyev, Feb 11 2012
STATUS
approved