login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A069018
Smallest square k > 0 such that n*k + 1 is also a square or 0 if no such term exists, i.e., when n is a square.
2
0, 4, 1, 0, 16, 4, 9, 1, 0, 36, 9, 4, 32400, 16, 1, 0, 64, 16, 1521, 4, 144, 1764, 25, 1, 0, 100, 25, 576, 3312400, 4, 74529, 9, 16, 36, 1, 0, 144, 36, 16, 9, 102400, 4, 281961, 900, 576, 12873744, 49, 1, 0, 196, 49, 8100, 82810000, 4356, 144, 4, 400, 6625476
OFFSET
1,2
COMMENTS
Terms from Robert G. Wilson v.
LINKS
MAPLE
f:= proc(n) local x, y, t, z, k, r;
if issqr(n) then return 0 fi;
t:= [isolve(n*x^2+1=y^2)];
z:= (indets(t, name) minus {x, y})[1];
for k from 0 do
r:= select(`>`, map(s -> eval(x, s), eval(t, z=k)), 0);
if nops(r) >= 1 then return min(r)^2 fi
od
end proc:
map(f, [$1..100]); # Robert Israel, Jun 29 2018
MATHEMATICA
Do[k = 0; If[ !IntegerQ[ Sqrt[n]], k = 1; While[ !IntegerQ[ Sqrt[n*k^2 + 1]], k++ ]]; Print[k^2], {n, 1, 35}] (* Robert G. Wilson v *)
CROSSREFS
Sequence in context: A007789 A345393 A081114 * A156811 A246609 A371080
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Apr 02 2002
EXTENSIONS
Offset corrected by Robert Israel, Jun 29 2018
STATUS
approved