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.

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