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.
Famous continued fractions compared: periodic = quadratic irrational
Convergents of pi: best rational approximations
Building pi's continued fraction: each convergent zooms in closer
Each convergent alternates above and below pi. The denominators jump from 7 to 106 to 113, a tiny increase that buys enormous precision. The famous 355/113 is the most striking: a 3-digit denominator matching pi to 6 decimal places, better than any fraction with a smaller denominator.
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.