Continued Fractions

pi = 3 + 1/(7 + 1/(15 + 1/(1 + 1/(292 + ...))))
written [3; 7, 15, 1, 292, 1, 1, 1, 2, ...]

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
Famous continued fractions compared: periodic = quadratic irrational

Table comparing continued fractions of phi sqrt2 e and pi showing which are periodic and which are irregular

CONSTANTCF NOTATIONTYPE
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
Convergents of pi: best rational approximations

Table of convergents of pi showing increasingly accurate rational approximations with small denominators

CONVERGENTDECIMALERROR
3/13.0000000.14159
22/73.1428570.00126
333/1063.1415090.000083
355/1133.141592…0.0000003
103993/331023.14159265…2.7e−10
355/113 is correct to 6 decimal places with only a 3-digit denominator
Successive convergents of π alternate above and below
33.053.13.14πpₙ/qₙ1245convergent n

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.

Related topics
Phi Sqrt2 Khinchin
Key facts about Continued Fractions

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.

Brukes i
Matematikk
Fysikk
Ingeniorvitenskap
🧬Biologi
💻Datavitenskap
📊Statistikk
📈Finans
🎨Kunst
🏛Arkitektur
Musikk
🔐Kryptografi
🌌Astronomi
Kjemi
🦉Filosofi
🗺Geografi
🌿Okologi
Want to test your knowledge?
Question
What is the continued fraction of sqrt(2)?
tap · space
1 / 10