OFFSET
1,3
COMMENTS
In Hurwitz and Kritikos (HK) a definite form a*x^2 + 2*b*x*y + c*y^2, denoted by f(a,b,c), has discriminant Delta = -D = b^2 - 4*a*c < 0. Usually this is F = [a,2*b,c] with discriminant Disc = 4*(b^2 - a*c) = 4*Delta. A definite form is reduced if 2*|b| <= a <= c, and if any of the inequalities reduces to an equality then b >= 0 (HK, p. 179). The positive definite case has a > 0 and c > 0. Here the forms F do not need to satisfy gcd(a,2*b,c) = 1. - Wolfdieter Lang, Mar 31 2019
REFERENCES
J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 360.
A. Hurwitz and N. Kritikos, transl. with add. material by W . C. Schulz, "Lectures on Number Theory", Springer-Verlag, New York, 1986, p. 186.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Robin Visser, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = A006371(2*n) for all n > 0. - Robin Visser, May 29 2025
EXAMPLE
a(5) = 2 because the two forms F = [a,2*b,c] with discriminant Disc = -4*5 = -20 are [1,0,5] and [2,2,3]. ([2,-2,3] is not reduced, (-2,2,-3) is not positive definite). - Wolfdieter Lang, Mar 31 2019
PROG
(SageMath)
def a(n):
ans = 0
for b in range(-isqrt(n/3), isqrt(n/3)+1):
for a in Integer(n+b^2).divisors():
if ((2*abs(b)==a) or (a^2==n+b^2)) and (b < 0): continue
if (a >= 2*abs(b)) and (a^2 <= n+b^2): ans += 1
return ans # Robin Visser, May 29 2025
CROSSREFS
KEYWORD
nonn,nice,easy
AUTHOR
EXTENSIONS
Name clarified by Wolfdieter Lang, Mar 31 2019
STATUS
approved
