%I #33 Feb 16 2025 08:32:45
%S 1,4,10,16,25,31,41,47,57,66,76,82,96,102,112,122,135,141,155,161,175,
%T 185,195,201,219,228,238,248,262,268,286,292,306,316,326,336,357,363,
%U 373,383,401,407,425,431,445,459,469,475,497,506,520,530,544,550,568
%N Number of ordered integer pairs (b,c), with -n<=b<=n, -n<=c<=n, such that both roots of x^2+bx+c=0 are integers.
%C Conjecture: The difference a(n)-a(n-1) is 6 if and only if n is a prime number. This has been checked up to about n=300 and may be easy to prove.
%C Preceding conjecture is a corollary of Jovovic's formula below. - _Eric M. Schmidt_, Aug 19 2012
%H Eric M. Schmidt, <a href="/A067274/b067274.txt">Table of n, a(n) for n = 0..10000</a>
%H Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/QuadraticEquation.html">Quadratic Equation</a>
%F a(n) = a(n-1)+2*(tau(n)+1)+A010052(n), n>1, a(1) = 4. - _Vladeta Jovovic_, Mar 05 2002, edited by _Eric M. Schmidt_, Aug 19 2012
%t a[n_] := If[n >= 1, 2 Sum[Length[Divisors[k]], {k, n}] + Floor[Sqrt[n]] + 2 n - 1]; Join[{1}, Table[a[n], {n, 50}]] (* _Lorenz H. Menke, Jr._, Apr 13 2016 *)
%o (Sage)
%o def A067274(max) :
%o res = [1]
%o term = 4
%o for ii in range(1, max+1) :
%o res += [term]
%o term += 2 * (number_of_divisors(ii+1) + 1) + is_square(ii+1)
%o return res
%o # _Eric M. Schmidt_, Aug 19 2012
%Y Cf. A010052.
%K nonn
%O 0,2
%A _John W. Layman_, Feb 21 2002