A continued fraction expresses a number as an integer plus the reciprocal of another continued fraction. Every real number has a unique continued fraction expansion. Rational numbers terminate; quadratic irrationals repeat periodically; transcendentals like pi have no pattern. The convergents (rational approximations formed by truncating) are provably the best approximations of any rational with that size denominator.
Table comparing continued fractions of phi sqrt2 e and pi showing which are periodic and which are irregular
| CONSTANT | CF NOTATION | TYPE |
|---|---|---|
| phi | [1; 1, 1, 1, 1, ...] | periodic |
| sqrt(2) | [1; 2, 2, 2, 2, ...] | periodic |
| sqrt(3) | [1; 1, 2, 1, 2, ...] | periodic |
| e | [2; 1, 2, 1, 1, 4, 1, 1, 6...] | pattern |
| pi | [3; 7, 15, 1, 292, 1, ...] | no pattern |
| Theorem: a CF is periodic if and only if the number is a quadratic irrational (Lagrange, 1770) | ||
| phi is the "hardest" to approximate: its CF of all 1s is the worst possible convergence |
Table of convergents of pi showing increasingly accurate rational approximations with small denominators
| CONVERGENT | DECIMAL | ERROR |
|---|---|---|
| 3/1 | 3.000000 | 0.14159 |
| 22/7 | 3.142857 | 0.00126 |
| 333/106 | 3.141509 | 0.000083 |
| 355/113 | 3.141592… | 0.0000003 |
| 103993/33102 | 3.14159265… | 2.7e−10 |
| 355/113 is correct to 6 decimal places with only a 3-digit denominator |
Convergents 3, 22/7, 333/106, 355/113, 103993/33102 alternate above and below π. Each is the best rational approximation with that denominator or smaller.
Every real number has a unique continued fraction expansion. Rational numbers have finite expansions. Quadratic irrationals (like sqrt(2) and phi) have eventually periodic expansions. Transcendentals like pi have no pattern. The convergents of a continued fraction are the best rational approximations: 22/7 and 355/113 are convergents of pi, matching it to 2 and 6 decimal places respectively. Phi = [1; 1, 1, 1, ...] is the hardest number to approximate, making it the most irrational in a precise sense.