Complete determination of the possible pairs of lengths of regular continued fractions of $\sqrt{D}$ and $(1 + \sqrt{D})/2$
Streszczenie
We completely characterize the possible pairs of lengths $\ell $ and $\ell ^*$ of the periods of the regular continued fractions of $\sqrt {D}$ and $(1 + \sqrt {D})/2$ for integers $D \gt 0$, $D \equiv 1 \pmod{4}$, $D$ not a square.
When $x^2 - D y^2 = 4$ has odd solutions and $\ell ^* \equiv 0 \pmod{3}$, we improve Ishii, Kaplan, and Williams’s [Acta Arith. 54 (1990)] bound $\ell \ge \ell ^* + 4$ to $\ell \ge \ell ^* + 8$. For every pair $\ell $, $\ell ^*$ not ruled out by previous literature or the results here, we give algorithms that generate infinitely many $D$ with that pair of lengths.
The result is the precise determination of which pairs of lengths $\ell $, $\ell ^*$ are possible when $x^2 - D y^2 = 4$ has odd solutions and which pairs are possible when $x^2 - D y^2 = 4$ does not have odd solutions.
These results carry over directly to the precise determination of the possible pairs of lengths of the periods of reduced forms in the principal classes of binary quadratic forms of discriminants $4 D$ and $D$.