%I #5 Jul 18 2013 17:46:05
%S 0,3,7,0,8,4,15,2,0,3,39,1,7,3,7,0,8,4,8,2,15,4,335,1,0,15,415,2,32,3,
%T 55,5,7,11,23,0,24,12,8,1,704,4,39,3,56,1631,2,0,35,1799,3,87,7,32,5,
%U 55,7,15,1,15,23,47,0,48,24,16,12,16,3,9235919,6,119,8,519,4,135,20,4959,3
%N Least k such that n*(k^2)+n*k+1 is a square, or 0 if n is a square.
%t ks[n_]:=Module[{k=1},If[IntegerQ[Sqrt[n]],0,While[!IntegerQ[ Sqrt[ n*k^2+n*k+1]], k++]; k]]; Array[ks,80] (* _Harvey P. Dale_, Jul 18 2013 *)
%K nonn
%O 1,2
%A _Pierre CAMI_, Mar 30 2005