I want to find the fundamental solution of:
$$ x^2 - dy^2 = 1 $$ where $d$ is of the form $d = m^2 + 2$. I know how to solve these kind of problems using the continued fraction of $\sqrt{d}$, but only for a specific $d$. How would I go about finding the continued fraction of $\sqrt{m^2 + 2}$?
\begin{eqnarray*} \sqrt{m^2+2}=m+\frac{2}{m+\sqrt{m^2+2}} \end{eqnarray*} iterating this formula gives (this step still needs to be formally justified) \begin{eqnarray*} \sqrt{m^2+2}=m+\frac{2}{2m+\frac{2}{2m+\frac{2}{2m+\frac{2}{2m+\ddots}}}} \\ \sqrt{m^2+2}=m+\frac{1}{m+\frac{1}{2m+\frac{1}{ m+\frac{1}{2m+\frac{1}{m+\ddots}}}}} \\ \end{eqnarray*}