OFFSET
1,1
LINKS
Bruno Berselli, Table of n, a(n) for n = 1..1000
EXAMPLE
a(1)=4 is the smallest positive integer such that 1^2+2*1*a(1) is a square, here 1+2*4 = 3^2.
a(2)=3 is the smallest positive integer such that 2^2+2*2*a(2) is a square, here 4+4*3 = 4^2.
a(3)=12 is the smallest positive integer such that 3^2+2*3*a(3) is a square, here 9+6*12 = 9^2.
MATHEMATICA
f[n_] := Block[{k = 1}, While[ !IntegerQ[ Sqrt[ n^2 + 2 n*k]], k++]; k]; Array[f, 64] (* Robert G. Wilson v, Jun 05 2014 *)
PROG
(PARI) a(n)=for(m=1, 1e9, issquare((n+m)^2-m^2)&return(m))
(Magma)
S:=[];
m:=1;
for n in [1..65] do
while not IsSquare((n+m)^2-m^2) do
m:=m+1;
end while;
Append(~S, m);
m:=1;
end for;
S; // Bruno Berselli, Jan 29 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
M. F. Hasler, Aug 05 2011
STATUS
approved