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-6 of 6 results.

A225953 Table for period length of periods of primitive reduced binary quadratic forms with discriminants D(n) = A079896(n).

Original entry on oeis.org

2, 2, 2, 2, 2, 6, 2, 2, 2, 2, 2, 4, 4, 2, 2, 2, 4, 4, 6, 6, 2, 10, 2, 2, 2, 2, 2, 2, 10, 2, 4, 4, 6, 6, 2, 2, 2, 2, 6, 6, 6, 2, 4, 4, 2, 2, 18, 6, 6, 2, 2, 2, 2, 6, 6, 6, 2, 6, 6, 14, 4, 4, 2, 2, 4, 4, 2, 2, 18, 6, 6, 2, 6, 6, 4, 4, 2, 2, 14, 4, 4, 14, 10, 2, 2, 4, 4, 2, 2, 8, 8, 2
Offset: 1

Views

Author

Wolfdieter Lang, May 27 2013

Keywords

Comments

The indefinite binary quadratic forms [a,b,c] have discriminant D := b^2 - 4*a*c > 0, not a square, given in A079896.
Primitive forms satisfy gcd(a,b,c) = 1. For the definition of reduced binary quadratic forms see a comment under A087048.
The number of periods of equivalent primitive reduced forms is given in A087048 (the class number).
Here the lengths of these periods is recorded. The computation is based on the book by Scholz and Schoeneberg. The row sums give A082174(n), the number of primitive reduced forms for D(n).
Two forms [a,b,c] and [a',b',c'] are properly equivalent if the 2 x 2 coefficient matrices A := [[a,b/2],[b/2,a]] and A' := [[a',b'/2],[b'/2,a']] satisfy A' = S^{-1,T} A S^{-1} with some matrix S, det S = +1 (T stands for transposed). The indeterminates (x,y) and (x',y') which represent the same number k = (x,y) A (x,y)^T = (x',y') A' (x',y')^T are related then by (x',y')^T = S (x,y)^T.
For the periods of primitive reduced forms for D(n), n = 1, ..., 101, see the link. See also the Buell reference, with the examples on p. 30, giving the periods for n = 1, ..., 20. They coincide with the ones given in the link up to the cyclic order in the periods.
All period lengths are even. See Buell, Proposition 3.6 on p. 24.

Examples

			The irregular table a(n,k) begins:
n/k  1   2  ...   D(n)    A087048(n)   A082174(n)
1:   2              5        1             2
2:   2              8        1             2
3:   2   2         12        2             4
4:   2             13        1             2
5:   6             17        1             6
6:   2             20        1             2
7:   2   2         21        2             4
8:   2   2         24        2             4
9:   4   4         28        2             8
10:  2             29        1             2
11:  2   2         32        2             4
12:  4   4         33        2             8
13:  6             37        1             6
14:  6   2         40        2             8
15: 10             41        1            10
16:  2   2         44        2             4
17:  2   2         45        2             4
18:  2   2         48        2             4
19: 10             52        1            10
20:  2             53        1             2
21:  4   4         56        2             8
... for rows up to n = 101 see the link.
a(1) = 2 because there are 2 = A082174(n) primitive reduced forms with discriminant D = 5, namely  [-1, 1, 1] and  [1, 1, -1], which are equivalent, and they give 1 = A087048(1) period [[[-1, 1, 1],[1, 1, -1]]] of length 2 = a(1,1).
Row n=3 is  2  2, because there are 4 primitive reduced forms for D = 12, appearing in 2 periods, each of length 2: [[[-1, 2, 2], [2, 2, -1]], [[1, 2, -2], [-2, 2, 1]]].
		

References

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

Crossrefs

Programs

  • SageMath
    def a(n, k):
        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)).reduced_form()
                if all([(not Q.is_equivalent(t)) for t in S]): S.append(Q)
        P = [len(Q.cycle(proper=True)) for Q in S]; P.sort(reverse=True);
        return P[k-1]  # Robin Visser, Jun 06 2025

Formula

a(n,k), n >= 1, k = 1, 2, ..., A087048(n), is the length of the period of the k-th primitive reduced forms for discriminant D(n) = A079896. The order in row n is nonincreasing.

Extensions

Offset corrected by Robin Visser, Jun 02 2025

A307359 Class number a(n) of indefinite binary quadratic forms with discriminant 4*A000037(n) for n >= 1.

Original entry on oeis.org

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

Views

Author

Wolfdieter Lang, Apr 04 2019

Keywords

Comments

This is a subsequence of A087048, See the formula.
This sequence is relevant for the Pell forms [1, 0, - D(n)], with D(n) = A000037(n) and discriminant 4*D(n).
The Buell reference, Table 2B, pp. 241-243, gives only the class numbers, called there H, for A000037(n) squarefree and not congruent to 1 modulo 4. E.g., a(3), related to discriminant 4*5 = 20, is not treated there; also a(6) for discriminant 32 = 4*(2*2^2) does not appear there.
For the a(n) cycles of primitive reduced forms of discriminant 4*A000037(n) see the W. lang link in A324251, Table 2 and Table 1, for n = 1..30. - Wolfdieter Lang, Apr 19 2019

Examples

			a(1) = 1 because 4*A000037(1) = 4*2 = 8 = A079896(e(1)) with e(1) = 1 and A087048(1) = 1.
a(12) = 4 because the twelfth even number of A079896 is 60 at position e(12) = 22, and A087048(22) = 4.
The cycle for discriminant 8 is [[1, 2, -1], [-1, 2, 1]].
The four 2-cycles for discriminant 60 are  [[1, 6, -6], [-6, 6, 1]], [[-1, 6, 6], [6, 6, -1]], [[2, 6, -3], [-3, 6, 2]] and  [[-2, 6, 3], [3, 6, -2]].
		

References

  • D. A. Buell, Binary Quadratic Forms, Springer, 1989.

Crossrefs

Programs

  • SageMath
    def a(n):
        i, D, S = 1, 4*n + 4*floor(1/2 + sqrt(n)), []
        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, Jun 01 2025

Formula

a(n) gives the number of distinct cycles of primitive reduced forms of discriminant 4*A000037(n).
a(n) = A087048(e(n)), with e(n) the position of the n-th even term of A079896, for n >= 1.

Extensions

a(40) corrected and more terms from Robin Visser, Jun 01 2025

A082175 Number of reduced indefinite quadratic forms over the integers in two variables with discriminants D(n)=A079896(n).

Original entry on oeis.org

2, 2, 4, 2, 6, 4, 4, 4, 8, 2, 6, 8, 6, 8, 10, 4, 6, 8, 12, 2, 8, 12, 8, 6, 12, 8, 8, 6, 18, 12, 4, 8, 16, 8, 12, 14, 8, 4, 16, 18, 6, 8, 20, 8, 14, 16, 14, 12, 6, 12, 16, 4, 14, 20, 16, 8, 20, 14, 8, 8, 28, 20, 10, 4, 22, 16, 10, 20, 20, 16, 12, 8, 20, 2, 20, 24, 20, 10, 24, 16, 8, 12
Offset: 1

Views

Author

Wolfdieter Lang, Apr 11 2003

Keywords

Comments

An indefinite quadratic form in two variables over the integers, a*x^2 + b*x*y + c*y^2 with discriminant D = b^2 - 4*a*c > 0, 0 or 1 (mod 4) and not a square, is called reduced if b>0 and f(D) - min(|2*a|,|2*c|) <= b < f(D), with f(D) := ceiling(sqrt(D)). See the Scholz-Schoeneberg reference for this definitions.

Examples

			a(1)=2 because there are two reduced forms for D(1)=A079896(1)=5, namely [a,b,c]=[-1, 1, 1] and [1, 1, -1]; here f(5)=3.
a(5)=6: for D(5)=A079896(5)=17 (f(17)=5) the 6 reduced [a,b,c] forms are [[-2, 1, 2], [2, 1, -2], [-2, 3, 1], [-1, 3, 2], [1, 3, -2], [2, 3, -1]]. They are all primitive (that is a,b and c are relatively prime).
a(6)=4: for D(6)=A079896(6)=20 (f(20)=5) there are four reduced forms: [-2, 2, 2], [2, 2, -2], [-1, 4, 1] and [1, 4, -1], Here two of them are nonprimitive, namely [-2, 2, 2], [2, 2, -2].
a(11)=6, D(11)=A079896(11)=32 (f(32)=6); the 6 reduced forms are [-4, 4, 1], [-2, 4, 2], [-1, 4, 4], [1, 4, -4], [2, 4, -2] and [4, 4, -1]. Two of them are nonprimitive, namely [ -2, 4, 2] and [2, 4, -2]. Therefore A082174(11)=4.
		

References

  • A. Scholz and B. Schoeneberg, Einführung in die Zahlentheorie, 5. Aufl., de Gruyter, Berlin, New York, 1973, ch.IV, par.31, p. 112.

Crossrefs

Cf. A082174 (number of primitive reduced forms).

Programs

  • SageMath
    def a(n):
        i, D, ans = 1, Integer(5), 0
        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 abs(sqrt(D) - 2*a) < b: ans += 1
        return 2*ans  # Robin Visser, May 31 2025

Formula

a(n)= number of reduced indefinite quadratic forms over the integers for D(n)=A079896(n) (counting also nonprimitive forms).

Extensions

Offset corrected and more terms from Robin Visser, May 31 2025

A358946 Positive integers that are properly represented by each primitive binary quadratic form of discriminant 28 that is properly equivalent to the principal form [1, 4, -3].

Original entry on oeis.org

1, 2, 9, 18, 21, 29, 37, 42, 53, 57, 58, 74, 81, 93, 106, 109, 113, 114, 133, 137, 141, 149, 162, 177, 186, 189, 193, 197, 217, 218, 226, 233, 249, 261, 266, 274, 277, 281, 282, 298, 309, 317, 329, 333, 337, 354, 361, 373, 378, 386, 389, 393, 394, 401, 413, 417, 421, 434, 449, 457, 466, 477, 498, 501
Offset: 1

Views

Author

Wolfdieter Lang, Jan 10 2023

Keywords

Comments

This is a subsequence of A242662, excluding the primitive forms of discriminant 28 with only improper representations of k, like k = 4, 8, 16, 25, 32, ... .
An indefinite binary quadratic primitive form F = a*x^2 + b*x*y + c*y^2 (gcd(a, b, c) = 1) with discriminant Disc = b^2 - 4*a*c = 28 = 2^2*7 is denoted by [a, b, c], or in matrix notation by MF = Matrix([[a, b/2], [b/2, c]]). Hence F = X*MF*X^T (T for transposed), where X = (x, y). See the two links for details and references.
Properly equivalent forms F' and F are related by a matrix R of determinant +1 like MF' = R^T*MF*R, and X'^T = R^{-1}*X^T.
Each primitive form, properly equivalent to the reduced principal form F_p = [1, 4, -3] for Disc = 28 (used in A242662), represents the given nonnegative k = a(n) values (and only these) properly with X = (x, y) and gcd(x, y) = 1. Modulo an overall sign change in X one can choose x nonnegative.
There are 8 = A082174(8) primitive reduced forms of Disc = 28 leading to 2 = A087048(8) (class number) cycles each of period 4, namely the principal cycle CyP = [[1, 4, -3], [-3, 2, 2], [2, 2, -3], [-3, 4, 1]] and the one (with outer signs flipped) CyP' = [[-1, 4, 3], [3, 2, -2], [-2, 2, 3], [3, 4, -1]].
There are A358947(n) representative parallel primitive forms (rpapfs) of discriminant Disc = 28 for k = a(n). This gives the number of proper fundamental representations X = (x, y), with x >= 0, of each primitive form [a, b, c], properly equivalent to the principal form F_p of Disc = 28.
For the negative integers k properly represented by primitive forms [a, b, c] properly equivalent to the principal form of Disc = 28 see A359476. The corresponding number of fundamental proper representations is given in A359477.
This and the three related sequences originated from a proposal by Klaus Purath proving that the form FKP := [1, -2, -6] of Disc = 28 represents k = k(m) = m^2 - 7 = A028881(m), for m >= 3, with the two fundamental representations X1(m) = (m+1, 1) and X2(m) = (11*m - 29, 3*m - 8). This form FKP is properly equivalent to the principal form F_p with R = Matrix([[1, -3], [0, 1]]). Hence all k = a(n) are represented by the form FKP, and A028881 is a subsequence of the present one.

Examples

			k = 9 = a(3): F = FPell = [1, 0, -7] is properly equivalent to F_p = [1, 4, -3] by two so-called half-reduced right neighbor R(t)-transformations, with the matrix R = R(t) = Matrix([[0, -1], [1, t]]), first with t = 0 then with t = 2. For FPell representing k = 9 with x > 0 and y > 0 see X_1(9, i) = (A307168(i), A307169(i)) and X_2(9, i) = (A307172(i), A307173(i)), for i >= 0. There are also the representations with y -> -y arising from the opposite fundamental solutions.
The 2 = A358947(3) rpapfs are F1 = [9, 8, 1] and F2 = [9, 10, 2]. They lead by proper equivalence transformations to a form of the above given principal cycle CyP. F1 -> [1, 4, -3] = F_p with matrix R(6), and F2 -> [2, 2, -3] with R(3). See the FIGURE, p. 10, of the linked paper.
Besides the primitive forms FPell, F1, F2 and the four forms of CyP also F' = [-7, 0, 1], and all primitive and properly equivalent forms represent k = 9. See the mentioned FIGURE, where FPa1 = F1, FPa1 = F2, Fpa2' = F_p^{(2)} = [2, 2, -3] and FPa2'' = F_p^{(3)} = [-3, 4, 1].
		

Crossrefs

A257004 Number of primitive Zagier-reduced indefinite quadratic forms over the integers in two variables with discriminants D(n) = A079896(n).

Original entry on oeis.org

1, 2, 3, 3, 5, 4, 4, 6, 7, 5, 5, 10, 7, 10, 11, 9, 6, 8, 10, 7, 10, 16, 12, 11, 16, 8, 10, 12, 21, 17, 8, 10, 14, 14, 18, 21, 13, 12, 14, 27, 11, 16, 26, 15, 17, 18, 23, 16, 10, 20, 25, 11, 13, 32, 14, 18, 26, 27, 18, 18, 38, 24, 15, 18, 28
Offset: 1

Views

Author

Barry R. Smith, Apr 17 2015

Keywords

Comments

An indefinite quadratic form in two variables over the integers, A*x^2 + B*x*y + C*y^2 with discriminant D = B^2 - 4*A*C > 0, 0 or 1 (mod 4) and not a square, is called Zagier-reduced if A>0, C>0, and B>A+C.
This definition is from Zagier's 1981 book, and differs from the older and more common notion of reduced form due to Lagrange (see A082175 for this definition).
A form is primitive if its coefficients are relatively prime.

Examples

			For D=20, the a(6)=4 Zagier-reduced primitive forms are x^2+6*x*y+4*y^2, 4*x^2+6*x*y+y^2, 4*x^2+10*x*y+5*y^2, and 5*x^2+10*x*y+4*y^2.
		

References

  • D. B. Zagier, Zetafunktionen und quadratische Körper, Springer, 1981. See page 122.

Crossrefs

Programs

  • Mathematica
    Table[Length[
      Select[Flatten[
        Select[
         Table[{a, k}, {k,
           Select[Range[Ceiling[-Sqrt[n]], Floor[Sqrt[n]]],
            Mod[# - n, 2] == 0 &]}, {a,
           Select[Divisors[(n - k^2)/4], # > (Sqrt[n] - k)/2 &]}],
         UnsameQ[#, {}] &], 1],
       GCD[#[[1]], #[[2]] +
           2*#[[1]], #[[1]] + #[[2]] - (n - #[[2]]^2)/(4*#[[1]])] == 1 &]], {n,
      Select[Range[
        153], ! IntegerQ[Sqrt[#]] && (Mod[#, 4] == 0 || Mod[#, 4] == 1) &]}]
  • SageMath
    def a(n):
        i, D, ans = 1, Integer(5), 0
        while(i < n):
            D += 1; i += 1*(((D%4) in [0, 1]) and (not D.is_square()))
        for k in range(-isqrt(D), isqrt(D)+1):
            if ((D-k^2)%4 != 0): continue
            for h in Integer((D-k^2)/4).divisors():
                if gcd([h, k+2*h, (k+h-(D-k^2)/(4*h))])==1:
                    if h > (sqrt(D)-k)/2: ans += 1
        return ans  # Robin Visser, Jun 01 2025

Extensions

Offset corrected by Robin Visser, Jun 01 2025

A307236 One half of the number of primitive reduced binary quadratic forms for discriminant 4*A000037(n), for n >= 1.

Original entry on oeis.org

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

Views

Author

Wolfdieter Lang, Mar 30 2019

Keywords

Comments

This is a subset of one half of A082174. See the formula.
This sequence is also one half of the total length of the A307359(n) cycles for discriminant 4*D(n), with D(n) = A000037(n). See the W. Lang link in A324251, Table 2, last column SigmaL(n) = 2*a(n). - Wolfdieter Lang, Apr 19 2019

Examples

			a(5) = 4 because the fifth even term of A079896 is at position e(5) = 8, and A082174(8)/2 = 4.
The 2*a(5) = 8 primitive reduced forms for discriminant 4*A000037(5) = 4*7 = 28 are [[-2, 2, 3], [2, 2, -3], [-3, 2, 2], [3, 2, -2], [-1, 4, 3], [1, 4, -3], [-3, 4, 1], [3, 4, -1]].
The preceding 8 forms give the 2 = A307359(5) 4-cycles CR(5) = [[1, 4, -3], [-3, 2, 2], [2, 2, -3], [-3, 4, 1]], the principal cycle with the principal reduced form [1, 4, -3], and the 4-cycle obtained from this by a sign flip of the outer form entries. - _Wolfdieter Lang_, Apr 19 2019
		

Crossrefs

Formula

a(n) = A082174(e(n))/2, with e(n) the position of the n-th even term of A079896.
Showing 1-6 of 6 results.