|
|
A242942
|
|
Consider a number n with m decimal digits. The sequence lists the numbers n having the prefix of length m-1 in the middle of the decimal expansion of n^2.
|
|
1
|
|
|
23, 25, 27, 405, 441, 505, 605, 705, 760, 805, 905, 1005, 2005, 2434, 3005, 37600, 61613, 62500, 67947, 128891, 132715, 156255, 5654702, 6375451, 9256309, 9376000, 17135260, 379188333, 382287618, 393413185, 486327938, 492143192, 524552424, 668002006, 734491215, 824207645, 906250000, 930590837, 964940231
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
EXAMPLE
|
441 is in the sequence because 441^2 = 194481 and the prefix 44 is in the middle of the decimal expansion of 194481.
|
|
MATHEMATICA
|
lst={}; Do[a=IntegerDigits[n^2]; b=Length[a]; c=IntegerLength[(n-Mod[n, 10])/10]; If[EvenQ[b-c]&&FromDigits[Take[a, {(b-c)/2+1, (b+c)/2}]]==(n-Mod[n, 10])/10, AppendTo[lst, n]], {n, 23, 5*10^6}]; lst
|
|
PROG
|
(PARI) ok(n)={my(t=n^2, d=logint(n, 10), b=(1+logint(t, 10)-d)/2 ); d>0 && frac(b)==0 && t\10^b%10^d==n\10}
{ for(n=1, 10^6, if(ok(n), print1(n, ", "))) } \\ Andrew Howroyd, Mar 02 2020
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|