Maths WorkshopMaths problems with full solutions
Exercise 1300Algebra › Equations and radicalsOlympiadAdded 5 Nov 2026

Approximating √2 by 1 + 1/(1 + x)

#continued fractions#sequences#Pell equation#approximation

Statement

Define x0=1x_0=1 and xn+1=1+11+xnx_{n+1}=1+\dfrac1{1+x_n}. Write xn=pnqnx_n=\dfrac{p_n}{q_n} with p0=q0=1p_0=q_0=1 and pn+1=pn+2qnp_{n+1}=p_n+2q_n, qn+1=pn+qnq_{n+1}=p_n+q_n.

  1. Prove that xn→2x_n\to\sqrt2 and estimate the error.
  2. Prove that pn2−2qn2=(−1)n+1p_n^2-2q_n^2=(-1)^{n+1}.
  3. Deduce that ∣2−pnqn∣<12qn2\left|\sqrt2-\dfrac{p_n}{q_n}\right|<\dfrac1{2q_n^2}.
Hint

For part 1, compute xn+1−2x_{n+1}-\sqrt2 in terms of xn−2x_n-\sqrt2. For part 2, compute pn+12−2qn+12p_{n+1}^2-2q_{n+1}^2 from the recurrences.

Show solutionHide solution

Solution

Consistency. 1+11+p/q=1+qp+q=p+2qp+q1+\frac1{1+p/q}=1+\frac q{p+q}=\frac{p+2q}{p+q}, so xn=pnqnx_n=\frac{p_n}{q_n} indeed.

1. Since xn+1=2+xn1+xnx_{n+1}=\frac{2+x_n}{1+x_n},
xn+1−2=2+xn−2−2xn1+xn=(1−2)(xn−2)1+xn.x_{n+1}-\sqrt2=\frac{2+x_n-\sqrt2-\sqrt2x_n}{1+x_n}=\frac{(1-\sqrt2)(x_n-\sqrt2)}{1+x_n}.
All xn≥1x_n\ge1, so
∣xn+1−2∣≤2−12∣xn−2∣<∣xn−2∣4.|x_{n+1}-\sqrt2|\le\frac{\sqrt2-1}{2}|x_n-\sqrt2|<\frac{|x_n-\sqrt2|}{4}.
Hence ∣xn−2∣≤4−n∣x0−2∣→0|x_n-\sqrt2|\le4^{-n}|x_0-\sqrt2|\to0: geometric convergence.

2.
pn+12−2qn+12=(pn+2qn)2−2(pn+qn)2=−pn2+2qn2=−(pn2−2qn2).p_{n+1}^2-2q_{n+1}^2=(p_n+2q_n)^2-2(p_n+q_n)^2=-p_n^2+2q_n^2=-(p_n^2-2q_n^2).
The sign alternates, and p02−2q02=−1p_0^2-2q_0^2=-1, so pn2−2qn2=(−1)n+1p_n^2-2q_n^2=(-1)^{n+1}.

3. ∣2−pnqn∣=∣2qn2−pn2∣qn2(2+pnqn)=1qn2(2+xn)<12qn2\left|\sqrt2-\frac{p_n}{q_n}\right|=\dfrac{|2q_n^2-p_n^2|}{q_n^2\left(\sqrt2+\frac{p_n}{q_n}\right)}=\dfrac1{q_n^2\left(\sqrt2+x_n\right)}<\dfrac1{2q_n^2}, since 2+xn>2+1>2\sqrt2+x_n>\sqrt2+1>2.

First terms. 1, 32, 75, 1712, 4129,…1,\ \frac32,\ \frac75,\ \frac{17}{12},\ \frac{41}{29},\dots and 32−2⋅22=13^2-2\cdot2^2=1, 72−2⋅52=−17^2-2\cdot5^2=-1, 172−2⋅122=117^2-2\cdot12^2=1.

Lesson. An iteration x↦ax+bcx+dx\mapsto\frac{ax+b}{cx+d} with a fixed point α\alpha contracts: compute xn+1−αx_{n+1}-\alpha as a multiple of xn−αx_n-\alpha.