cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A006371 Number of positive definite reduced binary quadratic forms of discriminant -A014601(n).

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 2, 2, 1, 2, 3, 2, 2, 2, 3, 3, 2, 3, 4, 2, 1, 4, 5, 4, 2, 2, 4, 4, 3, 4, 5, 4, 1, 4, 7, 3, 3, 4, 5, 6, 3, 4, 6, 2, 2, 6, 8, 6, 3, 3, 5, 6, 3, 6, 8, 4, 2, 6, 10, 4, 2, 6, 5, 7, 5, 4, 8, 4, 3, 8, 10, 8, 3, 2, 7, 6, 4, 8, 10, 6, 1, 8
Offset: 1

Views

Author

Keywords

Examples

			For n = 6, the a(6) = 2 positive definite reduced binary quadratic forms of discriminant -A014601(6) = -12 are x^2 + 3*y^2 and 2*x^2 + 2*x*y + 2*y^2.  For n = 7, the a(7) = 2 positive definite reduced binary quadratic forms of discriminant -A014601(7) = -15 are x^2 + x*y + 4*y^2 and 2*x^2 + x*y + 2*y^2. For n = 8, the a(8) = 2 positive definite reduced binary quadratic forms of discriminant -A014601(8) = -16 are x^2 + 4*y^2 and 2*x^2 + 2*y^2. - _Robin Visser_, May 29 2025
		

References

  • H. Davenport, The Higher Arithmetic. Cambridge Univ. Press, 5th edition, 1982, p. 144.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • SageMath
    def a(n):
        D, ans = 2*n+1-(n+1)%2, 0
        for b in range(-isqrt(D/3), isqrt(D/3)+1):
            if ((D+b^2)%4 != 0): continue
            for a in Integer((D+b^2)/4).divisors():
                if ((abs(b)==a) or (a^2==(D+b^2)/4)) and (b < 0): continue
                if (a >= abs(b)) and (a^2 <= (D+b^2)/4): ans += 1
        return ans  # Robin Visser, May 29 2025

Formula

a(2*n) = A006374(n) for all n > 0. - Robin Visser, May 29 2025

Extensions

More terms from Sean A. Irvine, Mar 19 2017
Name clarified and offset corrected by Robin Visser, May 29 2025