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-10 of 14 results. Next

A079896 Discriminants of indefinite binary quadratic forms.

Original entry on oeis.org

5, 8, 12, 13, 17, 20, 21, 24, 28, 29, 32, 33, 37, 40, 41, 44, 45, 48, 52, 53, 56, 57, 60, 61, 65, 68, 69, 72, 73, 76, 77, 80, 84, 85, 88, 89, 92, 93, 96, 97, 101, 104, 105, 108, 109, 112, 113, 116, 117, 120, 124, 125, 128, 129, 132, 133, 136, 137, 140, 141, 145, 148
Offset: 1

Views

Author

Wolfdieter Lang, Jan 31 2003

Keywords

Comments

Numbers n such that n == 0 (mod 4) or n == 1 (mod 4), but n is not a square.
For an indefinite binary quadratic form over the integers a*x^2 + b*x*y + c*y^2 the discriminant is D = b^2 - 4*a*c > 0; and D not a square is assumed.
Also, a superset of A227453. - Ralf Stephan, Sep 22 2013
For the period length of the continued fraction of sqrt(a(n)) see A267857(n). - Wolfdieter Lang, Feb 18 2016
[I changed the offset to 1, since this is an important list. Many parts of the entry, including the b-file, will need to be changed. - N. J. A. Sloane, Mar 14 2023]

References

  • McMullen, Curtis. "Billiards and Teichmüller curves." Bulletin of the American Mathematical Society, 60:2 (2023), 195-250. See Table C.1.
  • A. Scholz and B. Schoeneberg, Einführung in die Zahlentheorie, 5. Aufl., de Gruyter, Berlin, New York, 1973, p. 112.

Crossrefs

Cf. A014601, A042948 (with squares), A087048 (class numbers), A267857.

Programs

  • Mathematica
    Select[ Range[148], (Mod[ #, 4] == 0 || Mod[ #, 4] == 1) && !IntegerQ[ Sqrt[ # ]] & ]
  • PARI
    seq(N) = {
      my(n = 1, v = vector(N), top = 0);
      while (top < N,
        if (n%4 < 2 && !issquare(n), v[top++] = n); n++;);
      return(v);
    };
    seq(62) \\ Gheorghe Coserea, Nov 07 2016

Formula

a(2*k^2 + 2*k + 1) = 4*(k+1)^2 + 1 for k >= 0. - Gheorghe Coserea, Nov 07 2016
a(2*k^2 + 4*k + 2 + (k+1)*(-1)^k) = (2*k + 3)*(2*k + 3 + (-1)^k) for k >= 0. - Bruno Berselli, Nov 10 2016

Extensions

More terms from Robert G. Wilson v, Mar 26 2003
Offset changed to 1 (since this is a list). - N. J. A. Sloane, Mar 14 2023

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

A003646 Class number of binary quadratic forms with fundamental discriminant A003658(n),n>=2.

Original entry on oeis.org

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

Views

Author

Keywords

References

  • D. A. Buell, Binary Quadratic Forms. Springer-Verlag, NY, 1989, pp. 236, 241.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

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

A256945 Number of periods of reduced indefinite binary quadratic forms with discriminant D(n) = A079896(n).

Original entry on oeis.org

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

Views

Author

Barry R. Smith, Apr 19 2015

Keywords

Comments

This is an ``imprimitive'' class number. Each a(n) is A087048(n) increased by the number of cycles of discriminant D(n) of imprimitive binary quadratic forms.
The gcd of the coefficients is the same for each form within a cycle, so is a cycle invariant. There will exist cycles with gcd invariant equal to k precisely when D(n)/k^2 = A079896(m) for some m. In this case, the number of such cycles is A087048(m).

Examples

			a(6) gives the number of cycles of reduced indefinite forms of discriminant D(6) = 20.  This is the sum A087048(1) + A087048(6) = 2.
		

References

  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, 3rd. ed. See Section 3.3 on page 359.

Crossrefs

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():
                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

Formula

a(n) is the sum A087048(m) over all integers m with D(m)= D(n)/k^2 for some integer k.

Extensions

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

A317990 Number of genera of real quadratic field Q(sqrt(k)), k squarefree > 1.

Original entry on oeis.org

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

Views

Author

Jianing Song, Oct 03 2018

Keywords

Comments

The number of genera of a quadratic field is equal to the number of elements x in the class group such that x^2 = e where e is the identity.
This is the analog of A003643 for real quadratic fields. Note that for this case "the class group" refers to the narrow class group, or the form class group of indefinite binary forms with discriminant k.

Crossrefs

Programs

  • PARI
    for(n=2, 200, if(issquarefree(n), print1(2^(omega(n*if(n%4>1, 4, 1)) - 1), ", ")))

Formula

a(n) = 2^(omega(A005117(n)-1)) = 2^A317992(n), where omega(k) is the number of distinct prime divisors of k.

Extensions

Offset corrected by Jianing Song, Mar 31 2019

A317991 2-rank of the narrow class group of real quadratic field with discriminant A003658(n), n >= 2.

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 2, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 2, 0, 0, 2, 1, 1, 1, 1, 0, 2, 1, 1, 0, 1, 2, 0, 1, 2, 2, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 2, 1, 1, 1, 1, 2, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 2, 1, 1, 0, 2, 0, 2, 0, 1
Offset: 2

Views

Author

Jianing Song, Oct 03 2018

Keywords

Comments

The p-rank of a finite abelian group G is equal to log_p(#{x belongs to G : x^p = 1}) where p is a prime number. In this case, G is the narrow class group of Q(sqrt(k)) or the form class group of indefinite binary quadratic forms with discriminant k, and #{x belongs to G : x^p = 1} is the number of genera of Q(sqrt(k)) (cf. A317989).
This is the analog of A319659 for real quadratic fields.

Crossrefs

Programs

  • Mathematica
    PrimeNu[Select[Range[2, 300], NumberFieldDiscriminant[Sqrt[#]] == #&]] - 1 (* Jean-François Alcover, Jul 25 2019 *)
  • PARI
    for(n=2, 1000, if(isfundamental(n), print1(omega(n) - 1, ", ")))

Formula

a(n) = omega(A003658(n)) - 1 = log_2(A317989(n)), where omega(k) is the number of distinct prime divisors of k.

Extensions

Offset corrected by Jianing Song, Mar 31 2019

A317992 2-rank of the narrow class group of real quadratic field Q(sqrt(k)), k squarefree > 1.

Original entry on oeis.org

0, 1, 0, 1, 1, 1, 1, 0, 1, 2, 0, 1, 1, 1, 1, 1, 0, 2, 1, 1, 1, 2, 0, 1, 2, 0, 2, 1, 1, 1, 2, 0, 2, 1, 1, 1, 0, 1, 1, 2, 1, 1, 2, 1, 0, 1, 1, 2, 1, 1, 1, 1, 1, 2, 0, 2, 1, 1, 2, 0, 0, 2, 1, 2, 1, 1, 0, 2, 2, 0, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 0, 2, 1, 1, 1
Offset: 2

Views

Author

Jianing Song, Oct 03 2018

Keywords

Comments

The p-rank of a finite abelian group G is equal to log_p(#{x belongs to G : x^p = 1}) where p is a prime number. In this case, G is the narrow class group of Q(sqrt(k)) or the form class group of indefinite binary quadratic forms with discriminant k, and #{x belongs to G : x^p = 1} is the number of genera of Q(sqrt(k)) (cf. A317990).
This is the analog of A319662 for real quadratic fields.

Crossrefs

Programs

  • PARI
    for(n=2, 200, if(issquarefree(n), print1(omega(n*if(n%4>1, 4, 1)) - 1, ", ")))

Formula

a(n) = omega(A005117(n)) - 1 = log_2(A317990(n)), where omega(k) is the number of distinct prime divisors of k.

Extensions

Offset corrected by Jianing Song, Mar 31 2019

A104888 Class number of binary quadratic forms with radicand A005117(n).

Original entry on oeis.org

1, 2, 1, 2, 2, 2, 2, 1, 2, 4, 1, 2, 2, 2, 2, 2, 1, 4, 2, 2, 4, 4, 1, 2, 4, 1, 4, 2, 2, 2, 4, 1, 4, 2, 2, 2, 1, 2, 2, 4, 2, 2, 4, 2, 1, 2, 2, 4, 6, 4, 2, 2, 2, 4, 1, 4, 2, 2, 4, 1
Offset: 2

Views

Author

Steven Finch, May 03 2005

Keywords

Comments

The fundamental discriminant D and the radicand m (which is squarefree) are related via D=m if m=1 (mod 4) and D=4*m if m=2,3 (mod 4).

References

  • Hua Loo Keng, Introduction to Number Theory, Springer-Verlag, 1982, pp. 465-472.

Crossrefs

Showing 1-10 of 14 results. Next