%I #9 Oct 10 2016 02:45:39
%S 0,2,1,0,4,4,1,4,0,4,1,4,3,2,1,0,4,4,1,4,4,4,1,4,0,4,1,4,4,4,1,4,3,2,
%T 1,0,4,4,4,4,4,4,1,4,4,2,1,4,0,4,1,4,4,4,4,4,4,4,1,4,3,2,1,0,4,4,1,4,
%U 3,4,1,4,3,4,1,4,4,4,1,4,0,4,1,4,4,4,1,4,4,4,1,4,4,2,4,4,3,2,1,0,4,4,1,4,4
%N Smallest nonnegative value taken on by 4x^2 - ny^2 for an infinite number of integer pairs (x, y).
%t f[n_, z_] := FindInstance[x > 0 && y > 0 && 4*x^2 - n*y^2 == z, {x, y}, Integers, 1]; a[n_] := For[z = 0, z <= 4, z = z + GCD[n, 4], fz = f[n, z]; If[fz =!= {}, Print["a(", n, ") = ", z, " {x,y} = ", {x, y} /. fz[[1]]]; Return[z]]]; a[89] := (Print["a(89) = ", 4, " {x,y} = ", {500001, 106000}]; 4); a[97] := (Print["a(97) = ", 3, " {x,y} = ", {5, 1}]; 3); Table[TimeConstrained[a[n], 300], {n, 1, 105}] (* _Jean-François Alcover_, Oct 09 2016 *)
%K nonn
%O 1,2
%A _David W. Wilson_