OFFSET
1,3
MATHEMATICA
f[n_, z_] := FindInstance[x > 0 && y > 0 && 2*x^2 - n*y^2 == z, {x, y}, Integers, 1]; a[n_] := For[z = 0, True, z = z + GCD[n, 2], fz = f[n, z]; If[fz =!= {}, Print["a(", n, ") = ", z, " {x, y} = ", {x, y} /. fz[[1]]]; Return[z]]]; a[81] := (Print["a(81) = ", 2, " {x, y} = ", {19601, 3080}]; 2); Table[TimeConstrained[a[n], 300], {n, 1, 105}] (* Jean-François Alcover, Oct 09 2016 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved