Continued fraction of $\sqrt{67} - 4$ Find the continued fraction of $ \sqrt{67}-4 $ . $$ $$ We Know that if $ N $ is not a perfect square  and if continued fraction of $ \sqrt N $  is $ \sqrt N  =  [a_{1} , \overline {a_{2},a_{3} , \ldots , 2a_{1}} ]$  , then the continued fraction of $ \sqrt N-a_{1}$ is  $ \sqrt N-a_{1}=[\overline {0,a_{2},a_{3},\ldots,a_{n}, 2a_{1}}] $ . But I can't find the continued fraction of $\sqrt {67} $. Please someone help me
 A: The regular continued fraction expansion of $\sqrt{67}$ is
$$
8+\frac1{5+}\frac1{2+}\frac1{1+}\frac1{1+}\frac1{7+}\frac1{1+}\frac1{1+}\frac1{2+}\frac1{5+}\frac1{16+}\cdots\>,
$$
and the repeating part is the whole segment between the “$\frac1{5+}$” and the “$\frac1{16+}$”.
You may get it by a repeated process of “derationalizing the denominator”, starting with
$$
\frac{\sqrt{67}-8}1=\frac3{\sqrt{67}+8}=\frac1{\bigl(\sqrt{67}+8\bigr)\big/3}
=\frac1{5+}\frac{\sqrt{67}-7}3\,,\quad\text{etc.}
$$
But here’s an algorithm that mechanizes the whole process, I’m sure it’s well known:
If $N$ is a nonsquare positive integer, put $m=\lfloor \sqrt N\rfloor$, and start with the pair $(p,q)=(m,1)$, then, recursively, put
\begin{align}
q'&=\frac{N-p^2}q\\
d&=\left\lfloor\frac{p+m}{q'}\right\rfloor\\
p'&=dq'-p\quad.
\end{align}
Then the “output” $d$ of this step is the partial denominator that you will see in the continued-fraction expansion. And the process repeats after the first appearance of $d=2m$.
