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.

Showing 1-5 of 5 results.

A087048 Class numbers of indefinite quadratic forms over the integers in two variables with discriminant D = D(n) = A079896(n), n>=1.

Original entry on oeis.org

1, 1, 2, 1, 1, 1, 2, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2, 2, 1, 1, 2, 2, 4, 1, 2, 1, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 4, 1, 1, 2, 4, 2, 1, 2, 1, 1, 2, 4, 2, 1, 2, 2, 2, 2, 4, 1, 4, 2, 4, 3, 1, 2, 2, 4, 1, 4, 2, 1, 4, 4, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 4, 1, 1, 2, 2, 4, 4, 2, 2, 1, 2, 2, 2, 4, 4, 4, 2, 3, 2, 1, 2, 2, 4
Offset: 1

Views

Author

Wolfdieter Lang, Aug 07 2003

Keywords

Comments

An indefinite quadratic form over the integers in two variables F(x,y) := a*x^2 + b*x*y + c*y^2 has discriminant D := b^2 - 4*a*c >0 not a square (a and c non-vanishing); that is D=D(n)= A079896(n) = [5,8,12,13,17,20,21,...], n>=1.
For a given discriminant D from A079896(n) a reduced form [a,b,c] is defined by b>0 and f(D)-min(|2*a|,|2*c|) <= b < f(D), with f(D) := ceiling(sqrt(D)).
For a given discriminant D from A079896(n) every primitive reduced form [a,b,c] defines a periodic chain of such forms by applying repeatedly the transformation R(t)*[a,b,c]=[a'(t),b'(t),c'(t)]=[c,-b+2*c*t,F(-1,t)] with uniquely defined t= ceiling((f(D)+b)/(2*c))-1 if c>0 and t=-(ceiling((f(D)+b)/(2*|c|)-1)) if c<0. The number of such (different) periodic chains of primitive reduced forms is called the class number for this (indefinite) discriminant D from A079896(n). - Wolfdieter Lang, Jun 07 2013
A primitive form [a,b,c] has gcd(a,b,c)=1.
See the Appendix 2 of the Buell reference. pp. 235-243, for the class numbers, called H(D), for the fundamental discriminants 0 < D < 10000. Table 2A gives the class numbers for squarefree D == 1 (mod 4) and Table 2B the ones for D == 0 (mod 4), with D/4 squarefree and not congruent to 1 modulo 4 (compare Buell, p. 69, 1. and 2.). - Wolfdieter Lang, May 29 2013
For an online program for D < 10^6 see the Keith Matthews link. - Wolfdieter Lang, Jul 24 2019

Examples

			n=3, D(3) = A079896(3) = 12, a(3) = 2 because there are the following two periodic chains of primitive reduced forms [a,b,c] (both with period length 2): [[-2, 2, 1], [1, 2, -2]] and [[-1, 2, 2], [2, 2, -1]].
n=14, D(14) = A079896(14) = 40, a(14) = 2 because there are the following two periodic chains of primitive reduced forms [a,b,c] (with period length 6 resp. 2): [[-3, 2, 3], [3, 4, -2], [-2, 4, 3], [3, 2, -3], [-3, 4, 2], [2, 4, -3]] and  [[-1, 6, 1], [1, 6, -1]].
n=36, D(36) = A079896(36) = 89, a(36) = 1 because there is only one periodic chain of primitive reduced forms [a,b,c] (with period length 14): [[ -5, 3, 4], [4, 5, -4], [-4, 3, 5], [5, 7, -2], [-2, 9, 1], [1, 9, -2], [-2, 7, 5], [5, 3, -4], [-4, 5, 4], [4, 3, -5], [-5, 7, 2], [2, 9, -1], [-1, 9, 2], [2, 7, -5]]. See p. 116 of the Scholz/Schoeneberg reference which starts with the form [1, 9, -2].
n=62, D(62) = A079896(62) = 148, a(62) = 3 because there are three periodic chains of primitive reduced forms [a,b,c] (with period length 6 and 6 and 2, resp.): [[-7, 6, 4], [4, 10, -3], [-3, 8, 7], [7, 6, -4], [-4, 10, 3], [3, 8, -7]] and [[-4, 6, 7], [7, 8, -3], [-3, 10, 4], [4, 6, -7], [-7, 8, 3], [3, 10, -4]] and [[-1, 12, 1], [1, 12, -1]]. See p. 116 of the Scholz/Schoeneberg reference which starts with the forms [4, 10, -3] and [3, 10, -4] and [1, 12, -1], resp.
		

References

  • D. A. Buell, Binary Quadratic Forms, Springer, 1989.
  • A. Scholz and B. Schoeneberg, Einführung in die Zahlentheorie, 5. Aufl., de Gruyter, Berlin, New York, 1973, ch. 31, pp. 112 ff.

Crossrefs

See A006374 for another version. Cf. A079896.

Programs

  • SageMath
    def a(n):
        i, D, S = 1, Integer(5), []
        while(i < n):
            D += 1; i += 1*(((D%4) in [0, 1]) and (not D.is_square()))
        for b in range(1, isqrt(D)+1):
            if ((D-b^2)%4 != 0): continue
            for a in Integer((D-b^2)/4).divisors():
                if gcd([a, b, (D-b^2)/(4*a)]) > 1: continue
                Q = BinaryQF(a, b, -(D-b^2)/(4*a))
                if all([(not Q.is_equivalent(t)) for t in S]): S.append(Q)
        return len(S)  # Robin Visser, May 31 2025

Extensions

Offset corrected by Robin Visser, May 31 2025

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

A096445 Number of reduced primitive positive definite binary quadratic forms of determinant n^2.

Original entry on oeis.org

1, 1, 2, 2, 2, 4, 4, 4, 6, 4, 6, 8, 6, 8, 8, 8, 8, 12, 10, 8, 16, 12, 12, 16, 10, 12, 18, 16, 14, 16, 16, 16, 24, 16, 16, 24, 18, 20, 24, 16, 20, 32, 22, 24, 24, 24, 24, 32, 28, 20, 32, 24, 26, 36, 24, 32, 40, 28, 30, 32, 30, 32, 48, 32, 24
Offset: 1

Views

Author

N. J. A. Sloane, Aug 11 2004

Keywords

Comments

Equivalently, of discriminant -4n^2.

Examples

			There are three reduced binary quadratic forms ax^2 + bxy +cy^2, notated as (a,b,c), with a discriminant of -36 (equivalent to determinant of 9): (1,0,9); (3,0,3); and (2,1,5). (3,0,3) is not primitive, because a, b, and c are not coprime. (1,0,9) and (2,1,5) are primitive, so there are two primitive reduced binary quadratic forms with a determinant of 9. 9 is 3^2, so a(3) = 2.
		

Crossrefs

Equals A096446(n^2). Cf. A006374.

Extensions

a(8) onward from Jarrod G. Sage, Jul 11 2025

A096446 Number of reduced primitive positive definite binary quadratic forms of determinant n.

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 2, 3, 2, 2, 4, 2
Offset: 1

Views

Author

N. J. A. Sloane, Aug 11 2004

Keywords

Comments

Equivalently, of discriminant -4n.

Crossrefs

A096445(n) = a(n^2). A006374 gives the number if imprimitive forms are also included.

A006375 Number of equivalence classes of cycles (or periods) of reduced indefinite binary quadratic forms of determinant -n (see comments).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

From Robin Visser, Jun 05 2025: (Start)
Let a (classically integral) binary quadratic form f(x,y) = a*x^2 + 2*b*x*y + c*y^2 of determinant -n = a*c-b^2 (or equivalently, of discriminant 4*n = 4*(b^2 - a*c)) be denoted as the triple [a,b,c]. If n is not a square, then we can define a sequence of binary quadratic forms [a_0, b_0, c_0], [a_1, b_1, c_1], [a_2, b_2, c_2], ... by the following recursive definition: Let [a_0, b_0, c_0] = [a, b, c], and for each i >= 0, let [a_{i+1}, b_{i+1}, c_{i+1}] = [c_i, t, (t^2 - n)/c_i] where t is the largest integer such that t = -b_i (mod c_i) and t^2 < n, if such an integer t exists. Otherwise t is the smallest integer (in absolute value) which satisfies t = -b_i (mod c_i), taking t positive in the case of a tie (see Conway--Sloane pg 357).
Gauss showed that such sequences are eventually periodic, and we denote the cycle of f(x,y) as the set of all forms in the period of this sequence (see also A087048 for a similar definition of cycle). If n is a square, then this sequence terminates in a form [a_k, b_k, 0], and the definition must be modified slightly (see Conway--Sloane pg 359). Two binary quadratic forms f(x,y) and g(x,y) are said to be properly equivalent if they have the same cycle.
This sequence a(n) counts equivalence classes of such cycles of indefinite binary quadratic forms f(x,y) of determinant -n, with respect to a somewhat coarser notion of equivalence than proper equivalence; here the binary forms [a, b, c], [-a, b, -c], [c, b, a], and [-c, b, -a] are all counted as part of the same equivalence class. (End)

Examples

			From _Robin Visser_, Jun 08 2025: (Start)
For n = 1, every indefinite binary quadratic form of determinant -1 (equivalently discriminant 4) is equivalent to either 2*x*y - y^2 or 2*x*y, thus a(1) = 2.
For n = 2, every indefinite binary quadratic form of determinant -2 (equivalently discriminant 8) is equivalent to x^2 + 2*x*y - y^2, thus a(2) = 1.
For n = 3, every indefinite binary quadratic form of determinant -3 (equivalently discriminant 12) is equivalent to x^2 + 2*x*y - 2*y^2, thus a(3) = 1.
For n = 4, every indefinite binary quadratic form of determinant -4 (equivalently discriminant 16) is equivalent to either x^2 + 2*x*y - 3*y^2, 4*x*y - 2*y^2, or 4*x*y, thus a(4) = 3. (End)
		

References

  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 362.
  • C. F. Gauss, Disquisitiones arithmeticae, Yale University Press, New Haven, Conn.-London, 1966.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • SageMath
    def a(n):
        S = []
        for b in range(1, ceil(sqrt(n))):
            for a in Integer(n-b^2).divisors():
                c = (b^2-n)/a
                F = [BinaryQF(x,2*b,y) for (x,y) in [(a,c),(-a,-c),(c,a),(-c,-a)]]
                if all([(not Q.is_equivalent(t)) for t in S for Q in F]): S.append(F[0])
        if Integer(n).is_square():
            for c in range(-sqrt(n), sqrt(n)+1):
                F = [BinaryQF(x,2*sqrt(n),y) for (x,y) in [(0,c),(0,-c),(c,0),(-c,0)]]
                if all([(not Q.is_equivalent(t)) for t in S for Q in F]): S.append(F[0])
        return len(S)  # Robin Visser, Jun 06 2025

Extensions

Corrected Apr 15 1995
Name clarified by Robin Visser, May 30 2025
Term a(65) corrected and more terms from Robin Visser, Jun 06 2025
Showing 1-5 of 5 results.