# Periodic Continued Fractions

• A quadratic irrational is an irrational number which is a root of a quadratic equation with integer coefficients.
• Quadratic irrationals can be expressed in the form , where , , and q is positive and not a perfect square.
• Quadratic irrationals are exactly the real numbers which have infinite periodic continued fraction expansions.

Definition. A quadratic irrational is an irrational number which is a root of a quadratic equation

Lemma. A number is a quadratic irrational if and only if it can be written in the form , where , , and q is positive and not a perfect square.

Proof. Suppose x is a quadratic irrational. Then x is a root of

, , and are integers, and , since .

If , then , which is a rational number, contrary to assumption.

If , then x is complex, again contrary to assumption.

Hence, .

Finally, if is a perfect square, then is rational. Hence, is not a perfect square.

For the converse, suppose , where , , and q is positive and not a perfect square. Then

This is a quadratic equation with integer coefficients, and since . Therefore, x is a quadratic irrational.

Theorem. (Lagrange) The quadratic irrationals are exactly the real numbers which can be represented by infinite periodic continued fractions.

I'm going to prove one direction --- that periodic continued fractions are quadratic irrationals. I need a series of lemmas; the lemmas are motivated by the informal procedure of the following example.

Example. Consider .

I'll write x in closed form. Let . Then

On the other hand,

After some simplification, I get

y must be positive, so . Therefore,

The idea of the lemmas is simply to emulate the algebra I just did.

Lemma 1. If x is a quadratic irrational and is an integer, then is a quadratic irrational.

Proof. Write , where , , and b is positive and not a perfect square. Then

(I've suppressed the ugly algebra involved in combining the fractions and rationalizing the denominator.) The last expression is a quadratic irrational; note that , because b is not a perfect square.

Lemma 2. If x is a quadratic irrational and are integers, then

Proof. I'll use induction. The case was done in Lemma 1.

Suppose , and suppose the result is true for . Then in

is a quadratic irrational by the induction hypothesis.

But the original fraction is just , so it's a quadratic irrational by Lemma 1. This completes the induction step, so the result is true for all .

Lemma 3. Let . Then

where .

Proof. Your experience with algebra should tell you this is obvious, but I'll give the proof by induction anyway.

For , I have

This has the right form.

Take , and assume the result is true for . Then in

can be written as , , by induction.

The original fraction is therefore

(I've suppressed some easy but ugly algebra again.) The last fraction is in the right form, so this completes the induction step. The result is therefore true for all .

I'm ready to prove that periodic continued fractions are quadratic irrationals. First, I'll consider those that start repeating immediately.

Lemma 4. If , then

Proof. First, x is irrational, because it is an {\it infinite} continued fraction.

By Lemma 3,

where .

Hence,

Therefore, x is a quadratic irrational.

In the general case, the fraction does not start repeating immediately.

Proposition. If , then

Proof. is a quadratic irrational by Lemma 4. Therefore,

is a quadratic irrational by Lemma 2.

The converse states the quadratic irrationals give rise to periodic continued fractions. I won't give the proof; however, here's an example which shows how you can go from a quadratic equation to a periodic continued fraction (at least in this case).

Example. Suppose x is a quadratic irrational satisfying . Rewrite the equation as

Now substitute for x in the right side:

Do it again:

It's clear that you can keep going, and so .

Contact information