Partial quotients of continued fraction

430 Views Asked by At

Are the partial quotients in the fundamental period of $\sqrt{p}$ for an odd prime $p$ are always less than $\sqrt{p}$ (apart from obviously the last entry which is two times the nearest integer to $\sqrt{p}$), i.e. if $\sqrt{p} = \langle{n; \overline{a_{1}, a_{2},...,a_{r}}\rangle}$ where $a_{r} = 2n$, $n$ being the largest integer less than $\sqrt{p}$, then can $a_{i} > \sqrt{p}$ happen for any $i = 1,2,...,r-1$.

I was going through a list of continued fraction representation of $\sqrt{p}$ and it seemed the answer will be yes but could not find any result to back it up.

For example $\sqrt{19} = \langle{4; \overline{2,1,3,1,2,8}\rangle}$. None of the $a_{i} (\neq a_{6})$ is greater than $\sqrt{19}$.

$\sqrt{23} = \langle{4; \overline{1,3,1,8}\rangle}$. None of the $a_{i} (\neq a_{4})$ is greater than $\sqrt{23}$ again.