Continued Fractions
Summary: A continued fraction (CF) expresses a quantity as a nested sum , where are integers. CFs terminate iff is rational, and provide the best possible rational approximations to irrational numbers.
Sources: additions-1, additions-2
Last updated: 2026-05-10
Definition
In full generality, a continued fraction is
with and integers (positive or negative). Lagrange restricts attention to the unit-numerator form
since this is the only form of analytic utility (Add. I, Art. 1).
The integers are the partial quotients.
Generation by Iterated Integer-Part Extraction
Given any real , set
Substitution gives . The construction is uniquely determined by the choice “always take the integer below” (yielding all-positive partial quotients).
If at some stage , the process terminates. By Article 3 of Lagrange’s Addition I, this happens iff is rational.
Termination Criterion
| CF expansion | |
|---|---|
| Rational | Finite, last partial quotient appears explicitly |
| Irrational | Infinite, all partial quotients positive integers |
| Quadratic irrational | Infinite, eventually periodic — Lagrange proves this in Add. II, Art. 34 |
A CF terminating in unity (e.g. ) signals that the previous integer-part choice was not the nearest integer; the CF can be simplified by shortening: (Add. I, Art. 7).
Reduction Rule for Vulgar Fractions (Add. I, Art. 4)
To express as a CF:
- Divide by — quotient , remainder .
- Divide by — quotient , remainder .
- Divide by — quotient , remainder .
- Continue until the remainder is 0.
This is precisely the Euclidean algorithm (ch1.3.7-greatest-common-divisor); the partial quotients of the CF are the successive quotients in the gcd computation. Hence reducing a fraction to a CF and computing are the same procedure, just with different outputs collected.
Example (Art. 5): For ,
so , and .
Reduction of Decimals to CFs
For an irrational given to decimal places, both the truncated value and the value with the last digit increased by 1 are processed; the CF is taken only as far as the partial quotients agree (Add. I, Art. 8). Lagrange uses this on Ludolph’s 35-digit value of to extract the convergents up to and beyond.
Sign Conventions (Arts. 6–7)
If integer parts are always taken below the value: all . If always above: all . Mixed choices give mixed signs.
The transformation
flips a negative term back to positive at the cost of an inserted unit denominator; iterating produces an all-positive or all-negative form at will.
Why Continued Fractions Matter
A. Best rational approximations. The truncations — called convergents — are closer to than any other rational with smaller-or-equal denominator (see best-rational-approximations).
B. Diophantine algorithms. Solving in integers, and (the pell-equation), reduces in part to manipulating the CF of or .
C. Numerical root-finding. Roots of polynomial equations have CF expansions whose finitude detects rationality (Art. 9; cf. approximation-methods).
D. Calendar reform. The convergents to a year-length ratio give all “best” intercalation rules (see calendar-approximations).
Historical
- Brouncker (~1655): first use; expressed as a CF (Add. I, Art. 2).
- Wallis (Arithmetica Infinitorum): proved Brouncker’s CF equivalent to his own infinite product, gave the reduction-to-vulgar-fraction method.
- Huygens (Opera Posthuma): discovered the deep approximation properties; applied them to the gear-tooth ratios of his planetary automaton.
- Euler (Petersburg Commentaries IX, XI; Berlin Memoirs 1767–68): extensive arithmetical theory.
- Lagrange (these Additions): synthesis and best-approximation proofs.
Related pages
- convergents
- semi-convergents
- best-rational-approximations
- calendar-approximations
- add1-continued-fractions
- add2-arithmetic-problems
- periodicity-quadratic-irrationals
- binary-quadratic-forms
- square-root-continued-fractions
- ch1.3.7-greatest-common-divisor
- ch1.3.12-infinite-decimal-fractions
- approximation-methods