OFFSET
1,1
COMMENTS
Apart from the initial term, any number ends in 4 or 6.
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..10000
EXAMPLE
9 - 5*1 = 4 = 2^2;
64 - 5*11 = 9 = 3^2;
676 - 5*111 = 121 = 11^2.
MAPLE
P:=proc(q, h) local n; for n from 1 to q do
if type(sqrt(n^2-h*(10^(ilog10(n^2)+1)-1)/9), integer) then print(n^2);
fi; od; end: P(10^9, 5);
MATHEMATICA
sol[k_] := Block[{x, e = IntegerLength@k, d = Divisors@ k}, Union[ #+k/# & /@ Select[ Take[d, Ceiling[ Length@d/2]], EvenQ[x = #+k/#] && IntegerLength[ x^2/4] == e &]]^2/4]; r[n_] := 5 (10^n-1)/9; Flatten[sol /@ r /@ Range[12]] (* Giovanni Resta, May 18 2016 *)
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Paolo P. Lava, May 18 2016
STATUS
approved