# continued fraction for $\sqrt{n^2 − 1}$

Question:

Find the continued fraction for $\sqrt{n^2 − 1}$, where $n \ge 2$ is an integer.

My attempt:

$n - 1 = \sqrt{n^2} - 1 \lt \sqrt{n^2 − 1} \lt \sqrt{n^2}$

So far, $[n-1; ]$

$\sqrt{n^2 − 1} = n - 1 + \frac{1}{x}$

$\to \frac{1}{x} = \sqrt{n^2 - 1} - (n-1) \to \frac{1}{x^2} = n^2-1-n^2-1+2n-2\times(n-1)\times\sqrt{n^2-1} = 2\times(n-1)\times(1-\sqrt{n^2-1})$

But, it doesn't really help to find continued fraction.

\begin{align*}\sqrt{n^2-1} &= (n-1) + \sqrt{n^2-1} - (n-1) \\& = (n-1) + \dfrac{1}{\dfrac{1}{\sqrt{n^2-1}-(n-1)}}\\ &=(n-1) + \dfrac{1}{\dfrac{\sqrt{n^2-1}+(n-1)}{2(n-1)}} \\ &= (n-1) + \dfrac{1}{1 + \dfrac{\sqrt{n^2-1}-(n-1)}{2(n-1)}} \\& = (n-1) + \dfrac{1}{1 + \dfrac{1}{\dfrac{2(n-1)}{\sqrt{n^2-1}-(n-1)}}} \\&=(n-1) + \dfrac{1}{1 + \dfrac{1}{\dfrac{2(n-1)(\sqrt{n^2-1} + (n-1))}{2(n-1)}}} \\&=(n-1) + \dfrac{1}{1 + \dfrac{1}{\sqrt{n^2-1} + (n-1)}}\end{align*}
So $\sqrt{n^2-1} = [n-1;\ \overline{1,\ 2(n-1)}]$
Use that $$x = \frac{1}{\sqrt{n^2-1} - (n-1)} = 1+ \frac{\sqrt{n^2-1} - (n-1)}{2(n-1)} = 1 + \frac{1}{2(n-1)x}$$ to conclude that $$\sqrt{n^2-1} = [n-1; \overline{1, 2(n-1)}]$$