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.

A257009 Number of finite sequences of positive integers with alternant equal to n.

Original entry on oeis.org

4, 8, 9, 17, 14, 25, 22, 36, 25, 49, 31, 55, 49, 69, 41, 83, 52, 100, 66, 100, 66, 126, 84, 132, 88, 125, 95, 198, 82, 159, 119, 190, 125, 211, 125, 194, 135, 275, 128, 250, 152, 232, 191, 238, 174, 348, 150, 330, 223, 279, 158, 356, 220, 374, 217, 360, 196, 438
Offset: 3

Views

Author

Barry R. Smith, Apr 16 2015

Keywords

Comments

The alternant of a sequence of positive integers (c_1, ..., c_r) with r>=3 is the positive integer [c_1, ..., c_r] - [c_2, ..., c_{r-1}], in which an expression in brackets denotes the numerator of the simplified rational number with continued fraction expansion having the sequence of quotients in brackets. The alternant of (c_1) is c_1 and the alternant of (c_1, c_2) is c_1*c_2. There are finitely many sequences with given alternant >= 3. (There are infinitely many sequences with alternant 2 -- (2), (1,2), (2,1), and all sequences of the form (1,p,1). It is for this reason that the offset is 3.)
The number of Zagier-reduced binary quadratic forms with discriminant equal to n^2-4 or n^2+4
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=n^2+4 or n^2-4.
a(n) = A257007(n) + A257008(n)

References

  • D. B. Zagier, Zetafunktionen und quadratische Korper, Springer, 1981.

Crossrefs

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 = n^2-4 or n^2+4.

A257007 Number of Zagier-reduced binary quadratic forms of discriminant n^2-4.

Original entry on oeis.org

0, 0, 1, 3, 4, 7, 7, 12, 8, 20, 13, 18, 18, 31, 20, 31, 24, 39, 26, 53, 20, 66, 36, 36, 50, 76, 39, 62, 56, 92, 42, 72, 42, 120, 68, 72, 70, 136, 46, 126, 76, 112, 100, 96, 68, 146, 105, 125, 66, 226, 77, 168, 96, 138, 126, 160, 96, 228, 100, 142
Offset: 1

Views

Author

Barry R. Smith, Apr 16 2015

Keywords

Comments

The number of finite sequences of positive integers with odd length parity and alternant equal to n.
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=n^2-4.
The number of possible asymmetry types for the quotient sequence of the even-length continued fraction expansion of a rational number a/b, where b satisfies one of the congruences b^2 + nb + 1 = 0 (mod a) or b^2 - nb + 1 = 0 (mod a)

Examples

			For n=5, the a(5) = 4 Zagier-reduced forms of discriminant 21 are x^2 + 5*x*y + y^2, 5*x^2 + 9*x*y + 3*y^2, 3*x^2 + 9*x*y + 5*y^2, and 5*x^2 + 11*x*y + 5*y^2.
		

References

  • D. B. Zagier, Zetafunktionen und quadratische Korper, Springer, 1981.

Crossrefs

It appears that this sequence gives half the row sums of the triangle in A264597 (cf. A264598), and also the first column of A264597. - N. J. A. Sloane, Nov 19 2015

Programs

  • Maple
    # Maple code for the formula given by Kleban et al., which is almost certainly the same sequence as this (but until that is proved, the program should not be used to extend this sequence, A264598 or A264599). - N. J. A. Sloane, Nov 19 2015
    with(numtheory); # return number of divisors of m less than b
    dbm:=proc(b,m) local i,t1,t2;
    t1:=divisors(m); t2:=0;
    for i from 1 to nops(t1) do if t1[i]add(dbm(b,b*n-b^2-1), b=1..n-1);
    [seq(f(n),n=1..100)];
  • 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, Map[#^2 - 4 &, Range[3, 60]]}]
  • PARI
    d(n, k) = #select(x->(xMichel Marcus, Apr 18 2023; based on Technau Lemma 3

Formula

With D=n^2-4, 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.
From the Kleban et al. reference it appears that a(n) = Sum_{b=1..n-1} dbm(b,n*b-b^2-1), where dbm(b,m) = number of positive divisors of m that are less than b. - N. J. A. Sloane, Nov 19 2015

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

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

A257008 Number of Zagier-reduced binary quadratic forms of discriminant n^2+4.

Original entry on oeis.org

1, 2, 3, 5, 5, 10, 7, 13, 14, 16, 12, 31, 13, 24, 29, 38, 17, 44, 26, 47, 46, 34, 30, 90, 34, 56, 49, 63, 39, 106, 40, 87, 77, 70, 57, 139, 55, 58, 89, 149, 52, 138, 52, 136, 123, 92, 69, 223, 84, 104, 146, 111, 62, 218, 94, 214, 121, 132, 96, 296
Offset: 1

Author

Barry R. Smith, Apr 16 2015

Keywords

Comments

The number of finite sequences of positive integers with even length parity and alternant equal to n.
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=n^2+4.
The number of possible asymmetry types for the quotient sequence of the odd-length continued fraction expansion of a rational number a/b, where b satisfies one of the congruences b^2 + nb - 1 = 0 (mod a) or b^2 - nb - 1 = 0 (mod a)

Examples

			For n=4, the a(4) = 5 Zagier-reduced forms of discriminant 20 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, 5*x^2 + 10*x*y + 4*y^2, and 2*x^2 + 6*x*y + 2*y^2
		

References

  • D. B. Zagier, Zetafunktionen und quadratische Korper, Springer, 1981.

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, Map[#^2 + 4 &, Range[3, 60]]}]

Formula

With D=n^2+4, 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.

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

Original entry on oeis.org

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

Author

Barry R. Smith, Apr 19 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.
The row sums give A257003(n), the number of Zagier-reduced forms of discriminant D(n).
The number of entries in row n is A256945(n), the class number of primitive forms of discriminant D(n).

Examples

			The table a(n,k) begins:
n/k  1   2   3   4  ...   D(n)    A256945(n)   A257003(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   1                 20        2             5
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   2   1             32        3             7
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   1             45        3             7
18:  6   2   2   1         48        4            11
19: 10   3                 52        2            13
		

References

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

Crossrefs

Formula

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

Extensions

Offset corrected by Robin Visser, Jun 08 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

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