2\sqrt 2 too can be written as a periodic continued fraction, and its truncations give the best rational approximations of the number.

Example — Continued fraction of 2\sqrt 2

We look for x>0x>0 with x2=2x^2=2, that is x=1+x21x+1=1+(x1)x = 1 + \dfrac{x^2-1}{x+1} = 1 + (x-1). We rewrite x1=1x+1x-1 = \dfrac{1}{x+1} obtaining x=1+11+x.x = 1 + \frac{1}{1+x}. Substituting xx on the right at each step: 2=1+12+12+12+.\sqrt 2 = 1 + \cfrac{1}{2+\cfrac{1}{2+\cfrac{1}{2+\cdots}}}. All 22s after the first digit: 1,2,2,2,1,2,2,2,\ldots. The successive convergents are 1, 3/2, 7/5, 17/12, 41/29, 99/70,1,\ 3/2,\ 7/5,\ 17/12,\ 41/29,\ 99/70,\ldots (ratios of the Pell numbers); each is the best rational approximation of 2\sqrt 2 with denominator less than or equal to the given one. Check: 99/70=1,4142899/70 = 1{,}41428\ldots against 2=1,41421\sqrt 2 = 1{,}41421\ldots (error <104<10^{-4}).

Topics: Second-degree equations
Concepts: Convergents · Continued fraction · Pell numbers
Skills: Solving equations · Estimating