Continued fractions are an alternative way of representing numbers: a rational number gives a finite continued fraction, an irrational one gives an infinite one. When an infinite continued fraction is periodic, the trick for computing its value is to exploit its self-repeating structure and reduce to a second-degree equation.

Example — Computing an infinite continued fraction

Let f=1+21+21+21+f = 1 + \cfrac{2}{1+\cfrac{2}{1+\cfrac{2}{1+\cdots}}} Notice that 53<f<3\dfrac{5}{3} < f < 3.

Trick: the repeating part equals the whole expression, hence: f=1+2f    f2=f+2    f2f2=0    f=2f = 1 + \frac{2}{f} \implies f^2 = f + 2 \implies f^2-f-2=0 \implies \boxed{f = 2} (discarding f=1f=-1 because f>0f>0).

Topics: Second-degree equations
Concepts: Second-degree equation · Continued fraction
Skills: Solving equations