← back to Number Theory

Continued Fractions

Jim Hefferon · Elementary Number Theory · Ch. 8

A continued fraction writes a number as a chain of integer parts and reciprocals. The convergents (partial evaluations) are the best rational approximations. Quadratic irrationals like sqrt(2) have periodic continued fractions, and this connects to Pell's equation.

Convergents as best approximations

sqrt(2) = [1; 2, 2, 2, ...]. The convergents 1/1, 3/2, 7/5, 17/12, 41/29, ... alternate above and below sqrt(2), getting closer each time. No fraction with a smaller denominator gets closer.

Convergents of sqrt(2) on the number line sqrt(2) 1.0 1.25 1.5 1/1 3/2 7/5 17/12 41/29
Scheme

Pell's equation

The equation x^2 - D y^2 = 1 (for non-square D) has infinitely many solutions. The fundamental solution comes from the convergents of the continued fraction of sqrt(D). For sqrt(2) = [1; 2, 2, ...], the convergent 3/2 gives 3^2 - 2(2^2) = 9 - 8 = 1.

Scheme