Continued Fractions

A continued fraction expresses a number as an iterated sequence of nested fractions . Its key result: every real number has a continued fraction expansion that is finite iff the number is rational, and the truncations (convergents) are the best possible rational approximations. Applies to number theory, Diophantine approximation, Pell's equation, and the analysis of irrationality. Studied systematically by Euler, Lagrange, and Gauss in the 18th century, with roots in the Euclidean algorithm of antiquity.

A continued fraction represents a number in the form , where the are integers called partial quotients. Unlike decimal expansions, which depend on an arbitrary base, continued fractions are intrinsic to the number and reveal its deepest arithmetic structure — periodicity in the expansion corresponds exactly to quadratic irrationals. They matter because they produce the best rational approximations to any real number (the convergents), solve Pell's equation, and give clean irrationality and transcendence criteria. The surprising fact: the simplest possible continued fraction, all 's, equals the golden ratio , which is in a precise sense the "most irrational" number — the hardest to approximate by rationals.

The Core Insight

Any real number splits uniquely into its integer part and a fractional remainder . The trick is to invert the remainder — replacing a small number in by its reciprocal in — and repeat. This is precisely the Euclidean algorithm in disguise, and it terminates exactly when is rational. The list of integer parts you peel off at each stage is the continued fraction expansion.

Formal Statement

Simple Continued Fraction

A simple (regular) continued fraction is an expression

1
⟳This is the nested form; each is obtained by peeling off integer parts and inverting remainders.

where and are the partial quotients. We abbreviate this as . The expansion is finite if it terminates: .

Convergents

The -th convergent is the value obtained by truncating after :

2
⟳Evaluate the finite continued fraction from the innermost level outward.

The numerators and denominators satisfy the fundamental recurrence

3
⟳Replace in by the formal variable; induction on the structure of the nesting gives the linear recurrence.

with initial conditions .

Fundamental Properties of Convergents

For the convergents of any simple continued fraction:

(a) The determinant identity holds:
4
⟳Induct using the recurrence [3]; the cross-terms telescope and the sign alternates.
(b) Consecutive convergents differ by
5
⟳Divide [4] by .
(c) Even convergents increase to , odd convergents decrease to , and
6
⟳ lies between consecutive convergents; the gap [5] bounds the error, and .

Lagrange's Theorem on Periodicity

A simple continued fraction is eventually periodic if and only if is a quadratic irrational (a root of with , , and non-square discriminant). It is purely periodic iff and its conjugate satisfies (a reduced quadratic irrational).

Best Approximation Property

If is a convergent of , then for every rational with and :

7
⟳Solve , for integers using [4]; sign analysis shows the convergent error is strictly smaller.

Convergents are thus the best rational approximations of the second kind — no rational with a smaller or equal denominator approximates more closely (after weighting by the denominator).

Why It Holds / Derivation

The Continued Fraction Algorithm and Termination

We construct the expansion of a real and prove the rational/irrational dichotomy.

Step 1 — Peel the integer part. Set and . Then with the remainder . Step 2 — Invert and repeat. If , stop. Otherwise define and . Continuing, and . Step 3 — Rational case terminates. If in lowest terms, the algorithm reproduces the Euclidean algorithm: writing , the partial quotients are exactly the quotients in successive divisions. Since remainders form a strictly decreasing sequence of nonnegative integers, the process halts after finitely many steps. Hence rationals have finite expansions. Step 4 — Irrational case is infinite. If is irrational, no remainder is ever zero (a zero remainder would express as a finite continued fraction, which is rational by [2]–[3]). So the expansion is infinite. Step 5 — Convergence. From [5], the partial sums of form an alternating series with terms (the grow at least like Fibonacci numbers, so exponentially). Therefore converges to a limit, and that limit is by the nesting construction.

Uniqueness of the Expansion

Suppose as real numbers. Taking floors of both sides (using that all later force the tail to lie in ) gives . Subtracting and inverting reduces to , and induction yields for all . The only ambiguity is the finite-case convention , removed by requiring the last partial quotient to exceed .

Leonhard Euler | 1707–1783

Euler was the first to develop continued fractions into a systematic theory. In his 1737 paper De fractionibus continuis dissertatio, he proved that has the elegant expansion , establishing 's irrationality. He discovered the recurrence relations for convergents, connected continued fractions to infinite series and products, and laid groundwork that Lagrange would complete with the periodicity theorem. Euler's notation and computational facility turned a curiosity into a pillar of analytic number theory.

Building Intuition

Think of a real number as a point on a number line. The integer part tells you which integer interval it sits in. The leftover fraction is small, so its reciprocal is large — and the size of that reciprocal tells you how close is to the integer : a huge means is barely above . Each partial quotient is a "zoom-in" step. Large partial quotients signal that a particular convergent is an exceptionally good approximation (the next one barely improves on it) — this is exactly why has the famous approximation : the means is astonishingly accurate. Conversely, all-'s (the golden ratio) means every approximation is as bad as continued fractions allow — no convergent is ever especially good.

Geometric construction of convergents zig-zagging toward x

value n x p0/q0 p1/q1 p2/q2 p3/q3 p4/q4 Even convergents rise, odd fall — bracketing x

Worked Examples

Expanding a rational number: 67/29

Given: Find the continued fraction of via the Euclidean algorithm. Step 1: , so , remainder . Step 2: , so , remainder . Step 3: , so , remainder . Step 4: , so , remainder — stop.

Thus .

Check convergents using [3] with :
  • ✓

Verify [4]: . ✓

Approximating an irrational: √2

Given: Find the continued fraction of and a rational approximation accurate to . Step 1: , so ; remainder , reciprocal . Step 2: , so ; remainder again — the process repeats.

Therefore , purely periodic (consistent with Lagrange's theorem, since is a quadratic irrational).

Convergents via [3]:
  • while
Error bound from [6]: . Here , , so error . ✓

Common Misconceptions

Continued fraction convergents are NOT the same as decimal truncations. Truncating to gives a worse approximation than the convergent , which uses a smaller denominator yet is accurate to six decimal places. Best-approximation (Theorem [7]) is a property of convergents, not of decimal rounding. Also beware: the partial quotients are integers (for ), but the convergents are not the partial quotients — students frequently conflate the two sequences.

Not every good approximation is a convergent — but every "very good" one is

The fraction is a convergent of (), and is too. But approximates reasonably well, yet it is not a convergent. The precise statement (the converse direction) is: if , then must be a convergent. So merely "decent" approximations can be non-convergents, but anything beating the threshold is forced to be one. This shows the best-approximation property is sharp, not vacuous.

Connections

Continued fractions weave together several areas. The expansion algorithm is the Euclidean Algorithm applied to real numbers, so convergents inherit Bézout-type identities (the determinant relation [4] is exactly a Bézout coefficient). They give the complete solution to Pell's Equation : the fundamental solution comes from the convergents of at the end of its period. They are the principal tool in Diophantine Approximation, underlying Hurwitz's Theorem (every irrational has infinitely many with , with optimal precisely because of the golden ratio). Via the Gauss Map they connect to Ergodic Theory and the Gauss–Kuzmin distribution, which describes the statistical frequency of partial quotients.

Real-World Applications

  1. Calendar design. The tropical year is days; its continued fraction yields the convergent giving the Gregorian rule (97 leap days per 400 years).
  2. Gear ratios and orreries. Mechanical computers and planetary models use convergents to approximate irrational period ratios with small integer tooth counts — Huygens used -style convergents to design his planetarium gearing for Saturn.
  3. Pell's equation and cryptography. Solving via 's expansion underlies certain factorization attacks and the structure of real quadratic fields.
  4. Lattice reduction / signal processing. The Stern–Brocot tree and continued fractions identify rational resonances and aliasing frequencies; Wiener's attack on RSA recovers a small private exponent when has it as a convergent.
  5. Music theory. The equal-tempered scale approximates ; its convergent gives the twelve-tone octave division.
  6. Astronomy — synodic periods. Convergents of orbital period ratios predict planetary conjunction cycles and the Metonic cycle (19 years ≈ 235 lunar months).
  7. Numerical analysis. Continued-fraction expansions of functions (e.g., , , the error function) converge faster than power series in many regimes and are used in special-function libraries.

Historical Development

  • c. 300 BCE — Euclid's algorithm (Elements VII) implicitly computes continued fractions of ratios, the algorithmic seed of the theory.
  • 1572 — Rafael Bombelli approximates using an iterative scheme equivalent to a continued fraction.
  • 1613 — Pietro Cataldi develops continued fractions explicitly for square roots, introducing early notation.
  • 1655 — John Wallis coins "continued fraction" (fractio continua) in his Arithmetica Infinitorum and gives an infinite product/fraction for .
  • 1737 — Euler's De fractionibus continuis establishes the systematic theory, proves 's expansion, and derives the convergent recurrences.
  • 1768 — Lambert uses the continued fraction of to prove is irrational.
  • 1770 — Lagrange proves the periodicity theorem: eventual periodicity ⟺ quadratic irrational, and applies continued fractions to solve Pell's equation completely.
  • 1812 — Gauss studies the distribution of partial quotients (the Gauss–Kuzmin problem), founding the ergodic theory of continued fractions; Kuzmin resolves it rigorously in 1928.
  • 1891 — Hurwitz proves the optimal approximation theorem with the constant , pinning down the golden ratio's extremal role.

Subtleties & Limits

The continued fraction of has no known pattern. Despite following a clean rule, the expansion of appears statistically random, and it is an open question whether its partial quotients are bounded or follow the Gauss–Kuzmin distribution. More broadly, it is unknown whether (or any specific algebraic irrational of degree , like ) has bounded partial quotients. Khinchin's theorem shows that for almost every real number the geometric mean of the partial quotients converges to Khinchin's constant — yet no explicit "natural" constant has been proven to obey this, and verifying it for or remains out of reach. The deep mystery is that cubic and higher algebraic irrationals have no known periodicity or pattern, in stark contrast to the perfectly periodic quadratic case.

See Also

Euclidean Algorithm · Pell's Equation · Diophantine Approximation · Quadratic Irrationals · Golden Ratio · Gauss Map and Ergodic Theory · Hurwitz's Theorem · Stern–Brocot Tree · Khinchin's Constant

Before this

Where this leads