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

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

A257006 Irregular triangle read by rows: period lengths of periods of primitive Zagier-reduced binary quadratic forms with discriminants D(n) = A079896(n).

Original entry on oeis.org

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

Views

Author

Barry R. Smith, Apr 20 2015

Keywords

Comments

The possible positive nonsquare discriminants of binary quadratic forms are given in A079896.
For the definition of Zagier-reduced binary quadratic forms, see A257003.
A form is primitive if its coefficients are relatively prime.
The row sums give A257004(n), the number of primitive Zagier-reduced forms of discriminant D(n).
The number of entries in row n is A087048(n), the class number of primitive forms of discriminant D(n).

Examples

			The table a(n,k) begins:
n/k  1   2   ...   D(n)    A087048(n)   A257004(n)
1:   1               5        1             1
2:   2               8        1             2
3:   2   1          12        2             3
4:   3              13        1             3
5:   5              17        1             5
6:   4              20        1             4
7:   3   1          21        2             4
8:   4   2          24        2             6
9:   5   2          28        2             7
10:  5              29        1             5
11:  4   1          32        2             5
12:  6   4          33        2            10
13:  7              37        1             7
14:  6   4          40        2            10
15: 11              41        1            11
16:  6   3          44        2             9
17:  5   1          45        2             6
18:  6   2          48        2             8
19: 10              52        1            10
		

References

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

Crossrefs

Formula

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

Extensions

Offset corrected by Robin Visser, Jun 08 2025
Showing 1-2 of 2 results.