## Monday, June 20, 2016

### Continued fraction expansion of the square root of n

Results from Galois imply that the continued fraction expansion of $\sqrt{n}$ is of the form $[a_0; \overline{a_1,a_2,\cdots, a_2, a_1, 2a_0}]$ (see also Ref.[1], page 469).

In OEIS sequences A031710, A031712, A031713, A031749 and several other sequences, the least number among the periodic part of the continued fraction expansion is considered, i.e what is $\delta(n) \triangleq \min (a_1,a_2,\cdots, a_2, a_1, 2a_0)$?

If  $t$ is an integer that divides $2k$, then it is straightforward to verify that the continued fraction expansion of $\sqrt{(km)^2+tm}$ for $m \geq 1$ is equal to $[km; \overline{\frac{2k}{t}, 2km}]$.  This implies the following result:

If $r$ is even, then $\delta((\frac{rm}{2})^2+m) = r$ for all $m\geq 1$.
If $r$ is odd, then $\delta((rm)^2+2m) = r$ for all $m\geq 1$.

References:
[1] Charles Smith, A Treatise on Algebra, Fifth Edition, Macmillan and Co., 1896.