Solve the equation $x=[2;2,2,\ldots,2,2,x]$ Solve the equation
$x=[2;2,2,\ldots,2,2,x]$
where there are n layers of continued fractions. 
Can someone start off the solution for me? I think it may be using induction.
 A: For starters,
$$ [\underbrace{2,2,\ldots,2,2}_{m\text{ times}}]=\frac{P_{m+1}}{P_m}\tag{1} $$
where $P_m=\frac{(1+\sqrt{2})^m-(1-\sqrt{2})^m}{2\sqrt{2}}$ is a Pell number. It follows that the equation
$$ x=[\underbrace{2,2,\ldots,2,2}_{m\text{ times}},x]\tag{2} $$
is equivalent to:
$$ x = \frac{P_m+ P_{m+1} x}{P_{m-1}+P_m x}\tag{3} $$
and always has the same solutions for every $m\geq 1$: they are $\color{red}{1\pm\sqrt{2}}$.

Later rework. Let us do this step-by-step. First claim: the (Pell) numbers defined through $P_m = \frac{(1+\sqrt{2})^m-(1-\sqrt{2})^m}{2\sqrt{2}}$ are integers fulfilling the constraints $P_0=0, P_1=1$ and $P_{m+2}=2\,P_{m+1}+P_m$. The proof by induction is straightforward. Second claim:
$$ R_m= [\underbrace{2;2,\ldots,2}_{m\text{ times}}] = \frac{P_{m+1}}{P_m}.$$
Here we have $R_{m+1}=2+\frac{1}{R_m}$, hence a proof by induction is straightforward in this case, too.
The identity
$$ [\underbrace{2;2,\ldots,2}_{m\text{ times}},x] = \frac{P_m+P_{m+1}x}{P_{m-1}+P_m x} $$
then follows from the general theory of continued fractions: in order to have an explicit expression for $[a;b,c,d,x]$ it is enough to know $[a;b,c,d]$ and the previous convergent $[a;b,c]$. At last, to check
$$ \forall x\in\{1-\sqrt{2},1+\sqrt{2}\},\;\forall m\geq 1\qquad x=\frac{P_m+P_{m+1}x}{P_{m-1}+P_m x}$$
is just a matter of substituting the right things and simplifying.
A: Note that if $$x^{2}-2x-1=0\tag{1}$$ then $$x=2+\frac{1}{x}$$ but now we can replace $x$ in the denominator by $2+\frac{1}{x}$ so $$x=2+\frac{1}{2+\frac{1}{x}}\tag{2}$$ and so on $$x=2+\frac{1}{2+\frac{1}{2+\dots1/x}}\tag{3}$$ and obviously the solutions of $(1)$, hence of $(2)$ hence of $(3)$ are always $$x=\color{red}{1\pm\sqrt{2}}.$$
