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.

A226164 Sequence used for the quadratic irrational number belonging to the principal indefinite binary quadratic form.

This page as a plain text file.
%I A226164 #13 Jun 09 2025 01:05:18
%S A226164 1,2,2,3,3,4,3,4,4,5,4,5,5,6,5,6,5,6,6,7,6,7,6,7,7,8,7,8,7,8,7,8,8,9,
%T A226164 8,9,8,9,8,9,9,10,9,10,9,10,9,10,9,10,10,11,10,11,10,11,10,11,10,11,
%U A226164 11,12,11,12,11,12,11,12,11,12,11,12,12,13,12,13,12,13,12,13,12
%N A226164 Sequence used for the quadratic irrational number belonging to the principal indefinite binary quadratic form.
%C A226164 For an indefinite binary quadratic form, denoted by [a, b, c] for F = F([a, b, c],[x, y]) = a*x^2 + b*x*y + c*y^2, the discriminant is D = b^2 - 4*a*c > 0, not a square. See A079896 for the possible values.
%C A226164 The principal form for a discriminant D, which is reduced (see the Scholz-Schoeneberg reference, p. 112), is defined as the unique form F_p(D) = [a=1, b(D), c(D)] with c(D) = -(D - b^2)/4. See the Buell reference, p. 26. One can show that b(D) = f(D) - 2 if D and f(D):=ceiling(sqrt(D(n))) have the same parity and b(D) = f(D) - 1 if D and f(D) have opposite parity. The principal root of a form [a, b, c] of discriminant D is omega(D) = (-b + sqrt(D))/2, the zero with positive square root of the polynomial P(x) = a*x^2 + b*x + c. See the Buell reference, p. 31 (and p. 18). We prefer to call omega the quadratic irrational belonging to the form F. For the principal form F_p(D) of discriminant D = D(n) = A079896(n), n >= 1, this quadratic irrational is omega_p(D(n)) = (-b(D(n)) + sqrt(D))/2 where b(D(n)) is the present sequence a(n). (Note that this differs from the omega = omega(D) used in the Buell reference on p. 40 because another form of discriminant D has been chosen there, depending on the parity of D.)
%C A226164 The (purely periodic) continued fraction expansion of omega_p(D(n)) plays a role for finding all solutions of the Pell equation x^2 + D(n)*y^2 = - 4 if a solution exists. See A226696 for these D values. For the Pell +4 equation which has solutions for every D(n) one finds the fundamental solution also from the continued fraction expansion of omega_p(D(n)).
%C A226164 For more details see the W. Lang link "Periods of indefinite Binary Quadratic Forms ..." given in A225953.
%D A226164 D. A. Buell, Binary Quadratic Forms, Springer, 1989.
%D A226164 A. Scholz and B. Schoeneberg, Einführung in die Zahlentheorie, Sammlung Goeschen Band 5131, Walter de Gruyter, 1973.
%H A226164 Robin Visser, <a href="/A226164/b226164.txt">Table of n, a(n) for n = 1..10000</a>
%F A226164 Define D(n) := A079896(n) and f(n) = ceiling(sqrt(D(n))).
%F A226164 a(n) = f(n) - 2 if D(n) and f(n) have the same parity, and a(n) = f(n) - 1 if D(n) and f(n) have opposite parity.
%e A226164 a(1) = 1 because D(1) = A079896(1) = 5 and f(1) = 3; both are odd, therefore a(1) = 3 - 2 = 1.
%e A226164 a(2) = 2 from D(2) = 8, f(2) = 3, a(2) = f(2) - 1 = 2.
%e A226164 The quadratic irrational (principal root) of the principal form of discriminant D(5) = 17 which is F_p(17) = [1, 3, -2], is omega_p(17) = (-3 + sqrt(17))/2 approximately 0.561552813.
%e A226164   f(17) = 5, a(5) = 5 - 2 = 3 = b(17).
%o A226164 (SageMath)
%o A226164 def a(n):
%o A226164     i, D = 1, Integer(5)
%o A226164     while(i < n):
%o A226164         D += 1; i += 1*(((D%4) in [0, 1]) and (not D.is_square()))
%o A226164     return ceil(sqrt(D))-1-1*(D%2==ceil(sqrt(D))%2)  # _Robin Visser_, Jun 07 2025
%Y A226164 Cf. A079896, A226696, A225953.
%K A226164 nonn,easy
%O A226164 1,2
%A A226164 _Wolfdieter Lang_, Jul 20 2013
%E A226164 Offset corrected by _Robin Visser_, Jun 07 2025