Lecture 19: Continued Fractions III Quadratic Irrationals

William Stein

Math 124 Harvard University Fall 2001

In this lecture we prove that the continued fraction expansion of a number is periodic if and only if the number is a quadratic irrational.

1 Quadratic Irrationals

Definition 1.1. An element α ∈ ℝ is a quadratic irrational if it is irrational and satisfies a quadratic polynomial.

Thus, e.g., (1 + \sqrt{5})/2 is a quadratic irrational. Recall that

\frac{1 + \sqrt{5}}{2} = [1, 1, 1, …].

The continued fraction of \sqrt{2} is [1, 2, 2, 2, 2, 2, …], and the continued fraction of \sqrt{389} is

[19, 1, 2, 1, 1, 1, 1, 2, 1, 38, 1, 2, 1, 1, 1, 1, 2, 1, 38, …].

Does the [1, 2, 1, 1, 1, 1, 2, 1, 38] pattern repeat over and over again??

2 Periodic Continued Fractions

Definition 2.1. A periodic continued fraction is a continued fraction [a_{0}, a_{1}, …, a_{n}, …] such that

a_{n} = a_{n+h}

for a fixed positive integer h and all sufficiently large n. We call h the period of the continued fraction.

Example 2.2. Consider the periodic continued fraction [1, 2, 1, 2, …] = [\overline{1, 2}]. What does it converge to?

[\overline{1, 2}] = 1 + \frac{1}{2 + _{\frac{1}{1+_{\frac{1}{2+ \frac{1}{1+···}}}}}} ,

so if α = [\overline{1, 2}] then

α = 1 + \frac{1}{2 + α}.

Thus 2α + α^{2} = 2 + α + 1, so

α^{2} + α − 3 = 0 and α = \frac{−1 + \sqrt{7}}{2}.

Theorem 2.3. An infinite integral continued fraction is periodic if and only if it represents a quadratic irrational.

Proof. (⟹) First suppose that

[a_{0}, a_{1}, …, a_{n}, \overline{a_{n+1}, …, a_{n+h}}]

is a periodic continued fraction. Set α = [a_{n+1}, a_{n+2}, …]. Then

α = [a_{n+1}, …, a_{n+h}, α],

so

α = \frac{αp_{n+h} + p_{n+h−1}}{αq_{n+h} + q_{n+h−1}} .

(We use that α is the last partial convergent.) Thus α satisfies a quadratic equation. Since the a_{i} are all integers, the number

[a_{0}, a_{1}, …] = [a_{0}, a_{1}, …, a_{n}, α]

= a_{0} + \frac{1}{a_{1} + \frac{1}{a_{2}+···+α}}

can be expressed as a polynomial in α with rational coefficients, so [a_{0}, a_{1}, …] also satisfies a quadratic polynomial. Finally, α ∉ ℚ because periodic continued fractions have infinitely many terms.

(⟸) This direction was first proved by Lagrange. The proof is much more exciting! Suppose α ∈ ℝ satisfies a quadratic equation

aα^{2} + bα + c = 0

with a, b, c ∈ ℤ. Let [a_{0}, a_{1}, …] be the expansion of α. For each n, let

r_{n} = [a_{n}, a_{n+1}, …],

so that

α = [a_{0}, a_{1}, …, a_{n−1}, r_{n}].

We have

α = \frac{r_{n}p_{n} + p_{n−1}}{r_{n}q_{n} + q_{n−1}} .

Substituting this expression for α into the quadratic equation for α, we see that

A_{n}r_{n}^{2} + B_{n}r_{n} + C_{n} = 0,

where

A_{n} = ap_{n−1}^{2} + bp_{n−1}q_{n−1} + cq_{n−1}^{2},
B_{n} = 2ap_{n−1}p_{n−2} + b(p_{n−1}q_{n−2} + p_{n−2}q_{n−1}) + 2cq_{n−1}q_{n−2},
C_{n} = ap_{n−2}^{2} + bp_{n−2}q_{n−2} + cp_{n−2}^{2}.

Note that A_{n}, B_{n}, C_{n} ∈ ℤ, that C_{n} = A_{n−1}, and that

B^{2} − 4A_{n}C_{n} = (b^{2} − 4ac)(p_{n−1}q_{n−2} − q_{n−1}p_{n−2})^{2} = b^{2} − 4ac.

Recall from the proof of Theorem 2.3 of the previous lecture that

|α − \frac{p_{n−1}}{q_{n−1}} | < \frac{1}{q_{n}q_{n−1}} .

Thus

|αq_{n−1} − p_{n−1}| < \frac{1}{q_{n}} < \frac{1}{q_{n+1}} ,

so

p_{n−1} = αq_{n−1} + \frac{δ}{q_{n−1}} with |δ| < 1.

Hence

A_{n} = a (αq_{n−1} + \frac{δ}{q_{n−1}} )^{2} + b (αq_{n−1} + \frac{δ}{q_{n−1}} ) q_{n−1} + cq_{n−1}^{2}

= (aα^{2} + bα + c)q_{n−1}^{2} + 2aαδ + a\frac{δ^{2}}{q_{n−1}^{2}} + bδ

= 2aαδ + a\frac{δ^{2}}{q_{n−1}^{2}} + bδ.

Thus

|A_{n}| = |2aαδ + a\frac{δ^{2}}{q_{n−1}^{2}} + bδ| < 2|aα| + |a| + |b|.

Thus there are only finitely many possibilities for the integer A_{n}. Also,

|C_{n}| = |A_{n−1}| and |B_{n}| = \sqrt{b^{2} − 4(ac − A_{n}C_{n})},

so there are only finitely many triples (A_{n}, B_{n}, C_{n}), and hence only finitely many possibilities for r_{n} as n varies. Thus for some h > 0,

r_{n} = r_{n+h}.

This shows that the continued fraction for α is periodic.

3 What About Higher Degree?

Definition 3.1. An algebraic number is a root of a polynomial f ∈ ℚ[x].

Open Problem: ^{1} What is the continued fraction expansion of the algebraic number \sqrt[3]{2}?

1As far as I know this is still an open problem.

? contfrac(2^(1/3))
%5 = [1, 3, 1, 5, 1, 1, 4, 1, 1, 8, 1, 14, 1, 10, 2, 1, 4, 12, 2, 3,
2, 1, 3, 4, 1, 1, 2, 14, 3, 12, 1, 15, 3, 1, 4, 534, 1, 1, 5, 1, 1,
121, 1, 2, 2, 4, 10, 3, 2, 2, 41, 1, 1, 1, 3, 7, 2, 2, 9, 4, 1, 3, 7,
6, 1, 1, 2, 2, 9, 3, 1, 1, 69, 4, 4, 5, 12, 1, 1, 5, 15, 1, 4, 1, 1,
1, 1, 1, 89, 1, 22, 186, 5, 2, 4, 3, 3, 1, \ldots]

I sure don’t see a pattern, and that 534 strips me of any confidence that I ever will. One could at least try to analyze the first few terms of the continued fraction statistically (see Lang and Trotter, 1972).

Khintchine (1963), page 59:

No properties of the representing continued fractions, analogous to those which have just been proved, are known for algebraic numbers of higher degree. [...] It is of interest to point out that up till the present time no continued fraction development of an algebraic number of higher degree than the second is known. It is not even known if such a development has bounded elements. Generally speaking the problems associated with the continued fraction expansion of algebraic numbers of degree higher than the second are extremely difficult and virtually unstudied.

Richard Guy Unsolved Problems in Number Theory (1994), page 260:

Is there an algebraic number of degree greater than two whose simple continued fraction has unbounded partial quotients? Does every such number have unbounded partial quotients?