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 41 results. Next

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

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

A082174 Number of primitive 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, 2, 4, 4, 8, 2, 4, 8, 6, 8, 10, 4, 4, 4, 10, 2, 8, 12, 8, 6, 12, 2, 8, 4, 18, 12, 4, 4, 12, 8, 12, 14, 8, 4, 12, 18, 6, 8, 20, 4, 14, 8, 14, 10, 4, 12, 16, 2, 8, 20, 8, 8, 20, 14, 8, 8, 28, 14, 10, 4, 16, 16, 10, 12, 20, 6, 12, 8, 20, 2, 16, 24, 12, 10, 24, 16, 8, 8, 8, 30
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)). It is called primitive if gcd(a,b,c)=1 (relative prime). See the Scholz-Schoeneberg reference for these 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.
a(6)=2: 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], but only two of them are primitive, namely [-1, 4, 1] and [1, 4, -1].
		

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 and par.27, p. 97.

Crossrefs

Cf. A082175 (number of reduced forms, nonprimitive forms included).

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)Robin Visser, May 31 2025

Formula

a(n)= number of primitive reduced indefinite binary quadratic forms over the integers for D(n)=A079896(n).

Extensions

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

A257003 Number of 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, 5, 4, 6, 7, 5, 7, 10, 7, 10, 11, 9, 7, 11, 13, 7, 10, 16, 12, 11, 16, 13, 10, 14, 21, 17, 8, 15, 18, 14, 18, 21, 13, 12, 20, 27, 11, 16, 26, 18, 17, 25, 23, 21, 13, 20, 25, 12, 20, 32, 24, 18, 26, 27, 18, 18, 38, 31, 15, 18, 33
Offset: 1

Views

Author

Barry R. Smith, Apr 14 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).
The number of pairs of integers (h,k) with |k| < sqrt(D), k^2 congruent to D (mod 4), h > (sqrt(D) - k)/2, h exactly dividing (D-k^2)/4, where D=D(n) is the discriminant being considered.

Examples

			For D=20, the pairs (h,k) as above are: (1,4), (2,2), (4,2), (5,0), (4,-2). From these, the a(6)=5 Zagier-reduced forms may be enumerated as h*x^2 + (k+2*h)*x*y + (k+h-(D-k^2)/(4*h))*y^2, yielding x^2+6*x*y+4*y^2, 2*x^2+6*x*y+2*y^2, 4*x^2+10*x*y+5*y^2, 5*x^2+10*x*y+4*y^2, and 4*x^2+6*x*y+y^2.
		

References

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

Crossrefs

Programs

  • Mathematica
    Table[Length[
      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]], {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 h > (sqrt(D) - k)/2: ans += 1
        return ans  # Robin Visser, Jun 01 2025

Formula

a(n) equals the number of pairs (h,k) with |k| < sqrt(D), k^2 congruent to D (mod 4), h > (sqrt(D) - k)/2, h exactly dividing (D-k^2)/4, where D=D(n) is the discriminant being considered.

Extensions

Offset corrected by 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

A226166 One half of the length of the period of the principal indefinite quadratic binary form of discriminant D(n) = A079896(n).

Original entry on oeis.org

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

Views

Author

Wolfdieter Lang, Jun 16 2013

Keywords

Comments

The principal indefinite binary quadratic form F_p of discriminant D is [1, b(D), c(D)] with c(D) = -(D - b(D)^2)/4 and, using f(D) := ceiling(sqrt(D)), b(D) = f(D) - 2 if D and f(D) have the same parity, and b(D) = f(D) - 1 if D and f(D) have opposite parity. For the possible D values see A079896.
For example, D = 5, f(D) = 3, F_p(5) = [1, 1, -1]; D = 28, f(D) = 6, [1, 4, -3]; D = 20, f(D) = 5, [1, 4, -1]; D = 13, f(D) = 4, [1, 3 ,-1]. For the definition of the principal form see the Buell reference, p. 26. The period (called cycle by Buell) starting with this principal form (which is reduced) is the principal period, and the length of this period is 2*a(n) for D = D(n) = A079896(n). For all periods for D(n), n=1, ..., 100, see a link under A225953.
The quadratic irrational number belonging to the principal indefinite form F_p = [1, b(D), c(D)] from above is defined as omega_p(D) := (-b(D) + sqrt(D))/2 (see the general definition by Buell on p.31). This is a solution of x^2 + b(D)*x + c(D) = 0. This irrational omega_p(D) has a periodic regular continued fraction (r.c.f) with primitive period length a(n) if the form [-1, b(D), -c(D)] appears in the principal period. Otherwise the primitive period length of this r.c.f. is 2*a(n).
For the connection between the principal period (or cycle) of indefinite forms of discriminant D and the continued fraction expansion of omega_p(D) see the Buell reference, ch. 3.
The irrational omega_p(D(n)) is from the interval (0, 1/2) if
D and f(D) = ceiling(sqrt(D)) are of opposite parity, and from (1/2, 1) if they are of the same parity.
The irrational omega_p(D(n)) is an integer in the real quadratic field Q(sqrt(m(n))) with m(n) := squarefree part of D(n).

Examples

			a(1) = 1 because for D(1) = 5 the principal period is [[1, 1, -1], [-1, 1, 1]], and its length is 2.
a(1) = 1 because D(1) = 5, f(5) = 3, m(1)= 5, omega_p(5) = (-1 + sqrt(5))/2 = -1*1 + 1*eta(5), with eta(5) := (1 + sqrt(5))/2 (golden section), in the basis <1, eta(5)> for integers of Q(sqrt(5)) = Q(eta(5)). The regular continued fraction (r.c.f) is omega_p(5) = [0, period(1)], with period length 1 = a(1).
a(3) = 1 because for D(3) = 12 the principal period is [[1, 2, -2], [-2, 2, 1]], and its length is 2.
a(3) = 1 because D(3) = 12, f(12) = 4, m(3)= 3, omega_p(12) = -1 + sqrt(3), an integer of Q(sqrt(3)). Its regular continued fraction is [0, period(1,2)], with period length 2 = 2*a(3) because [-1, 2, 2] is not an element of the principal period.
a(5) = 3 from D(5) = 17, f(17) = 5, m(5)= 17, omega_p(17) = (-3 + sqrt(17))/2 = -2*1 + 1*eta(17), with eta(17) :=(1+sqrt(17))/2. This is an integer in Q(sqrt(17)), and the r.c.f. is omega_p(17) = [0,period(1,1,3)] with period length 3 = a(5).
a(6) = 1 from D(6) = 20, f(20) = 5, m(6) = 5, omega_p(20) = (-4 + sqrt(20))/2 = -3*1 + 2*eta(5) (see the example a(1)). The r.c.f. is [0,period(4)] with period length 1 = a(6).
The principal period (cycle) for D = 20 is [[1, 4, -1], [-1, 4, 1]] (the only period, see a link under A225953). The length of the period is 2 = 2*a(6).
		

References

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

Crossrefs

Programs

  • SageMath
    def a(n):
        i, D = 1, Integer(5)
        while(i < n):
            D += 1; i += 1*(((D%4) in [0, 1]) and (not D.is_square()))
        Q = BinaryQF.principal(D).reduced_form()
        return len(Q.cycle(proper=True))/2  # Robin Visser, Jun 01 2025

Formula

a(n) is one half of the (primitive) period length of the principal period of indefinite forms of discriminant D(n) = A079896(n), n >= 1.
a(n) is the (primitive) period length of the regular continued fraction (r.c.f.) of the quadratic irrational omega_p(D(n)) defined above for discriminant D(n) = A079896(n), n >= 1, if the form [-1, b(D), -c(D)] appears in the principal period. See the comment section for b(D) and c(D). Otherwise this r.c.f. has period length 2*a(n).

Extensions

Name changed and errors corrected by Wolfdieter Lang, Jun 16 2013
Offset corrected by Robin Visser, Jun 01 2025

A226696 Discriminants D of indefinite binary quadratic forms (given in A079896) which allow a solution of the Pell equation x^2 - D*y^2 = -4.

Original entry on oeis.org

5, 8, 13, 17, 20, 29, 37, 40, 41, 52, 53, 61, 65, 68, 73, 85, 89, 97, 101, 104, 109, 113, 116, 125, 137, 145, 148, 149, 157, 164, 173, 181, 185, 193, 197, 200, 212, 229, 232, 233, 241, 244, 257, 260, 265, 269, 277, 281, 292, 293, 296, 313, 317, 325, 328
Offset: 1

Views

Author

Wolfdieter Lang, Jun 21 2013

Keywords

Comments

The discriminants D = a(n) which are not squarefree (not in A226693), that is a(n) = k^2*D', lead to a Pell equation for D'. For example, a(2) = 8 leads to x^2 - 2*(2*y)^2 = -4. This has only improper positive integer solutions like (x, 2*y) = (2, 2), (14, 10), (82, 58), ... coming from the proper positive integer solutions of X^2 - 2*Y^2 = -1, (X, Y) = (1, 1), (7, 5), (41, 29), ...
The +4 Pell equation has a solution (in fact infinitely many solutions) for each D from A079896.

Examples

			Positive fundamental solutions (proper or improper):
n=1,  D=5:  (1, 1), (11, 5); (4, 2)
n=2,  D=8:  (2, 1)
n=3,  D=13: (3, 1), (393, 109); (36, 10)
n=4,  D=17: no proper solution; (8, 2)
n=5,  D=20: (4, 1)
n=6,  D=29: (5, 1), (3775, 701); (140, 26)
n=7,  D=37: no proper solution; (12, 2)
n=8,  D=40: (6, 1)
n=9,  D=41: no proper solution; (64, 10)
n=10, D=52: (36, 5)
n=11, D=53: (7, 1), (18557, 2549); (364, 50)
...
		

References

  • D. A. Buell, Binary Quadratic Forms, Springer, 1989, Sections 3.2 and 3.3, pp. 31-48.
  • A. Scholz and B. Schoeneberg, Einführung in die Zahlentheorie, 5. Aufl., de Gruyter, Berlin, New York, 1973, Paragraph 32, pp. 121-126.

Crossrefs

A003653 is a subsequence listing the fundamental discriminants in this sequence.

Programs

  • Mathematica
    solQ[d_] := Mod[d, 4] <= 1 && !IntegerQ[Sqrt[d]] && Reduce[x^2 - d*y^2 == -4, {x, y}, Integers] =!= False; Select[Range[328], solQ ] (* Jean-François Alcover, Jul 03 2013 *)
  • PARI
    isA226696(D) = if(D%4<=1&&!issquare(D), for(n=1,oo,if(issquare(D*n^2-4),return(1));if(issquare(D*n^2+4),return(0))), 0) \\ Jianing Song, Mar 02 2019

Formula

The sequence lists the increasing D values which are not a square, are 1 (mod 4) or 0 (mod 4) (members of A079896) and allow a solution (in fact infinitely many solutions) of x^2 - D*y^2 = -4.

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

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

A361165 Genus of Weierstrass curve with discriminant A079896(n) in moduli space M_4 of compact Riemann surfaces of genus 4.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Mar 14 2023

Keywords

References

  • McMullen, Curtis. "Billiards and Teichmüller curves." Bulletin of the American Mathematical Society, 60:2 (2023), 195-250. See Table C.3.

Crossrefs

Showing 1-10 of 41 results. Next