I am trying to prove that for any positive integer $\sqrt{n^{2}+1}= [n; \overline{2n}]$, where $\overline{2n}$ is infinitely repeating. I think the best way to do this is to use the continued fraction algorithm? but I can seem to get it at all. I know the algorithm is:
$x=a_{0}+t_{0}$ where $a_{0}= \lfloor x \rfloor, t_{0}= x- \lfloor x \rfloor$
$\frac{1}{t_{0}}= a_{1}+t_{1} $ with $a_{1}=\lfloor \frac{1}{t_{0}}\rfloor, t_{1}=\frac{1}{t_{0}}- \lfloor \frac{1}{t_{0}} \rfloor $
and you continue until $t_{k}=0$.
I try to input values in but even when I try examples like $n=2.3$ but it still doesn't work so I must be doing it all wrong.
I also want to prove $ \sqrt{n^{2}+2}= [n; \overline{n,2n}]$ and $\sqrt{n^{2}+2n}= [n; \overline{1,2n}]$ but I feel like if I can just get the first part I'll understand how to do the second and third.