Simple continued fraction of $\sqrt{d}$ with period of shortest length $3$

Yes there are infinitely many. And it is not difficult to find them.

We seek continued fractions of the form

$\sqrt{N}=[a,\overline{b,c,2a}]$

First off, add $a$ to get a "pure" periodic expression. We shall call the quadratic surd $x$:

$x=a+\sqrt{N}=[\overline{2a,b,c}]$

We may then render

$x=2a+\dfrac{1}{b+\dfrac{1}{c+\dfrac{1}{x}}}$

and upon clearing fractions

$(bc+1)x^2+(b-c-2a(bc+1))x-(2ab+1)=0$

Now comes the sneaky part. If the above quadratic equation over the integers is to have a root $a+\sqrt{N}$, its other root must be $a-\sqrt{N}$ forcing the linear coefficient to be exactly $-2a$ times the quadratic one! Thereby $b=c$ above and the quadratic equation simplifies to:

$(b^2+1)x^2-2a(b^2+1)x-(2ab+1)=0$

This gives an integer radicand whenever $2ab+1$ is a multiple of $b^2+1$, in which cases the common factor of $b^2+1$ may be cancelled from the quadratic equation leaving the equation monic.

Suppose, for example, we drop in $b=2$. Then $2ab+1$ is to be a multiple of $5$ and $a$ can be any whole number one greater than a multiple of $5$. Putting $a=1$ results in the "trivial" solution $\sqrt{2}=[1,\overline{2}]$, as the period is reduced from three to one due to $b=c=2a$. But this equality is avoided for larger eligible values of $a$ and we get a series of period $3$ solutions. In all cases $N$ is one fourth the discriminant of the monic polynomial obtained after cancelling out the $b^2+1$ factor:

$a=6\to \sqrt{41}=[6,\overline{2,2,12}]$

$a=11\to \sqrt{130}=[11,\overline{2,2,22}]$

$a=5k+1\to \sqrt{25k^2+14k+2}=[5k+1,\overline{2,2,10k+2}]$

There are more families of solutions like this with other values of $b$. Just put in an even positive value for $b$ (why even?) and turn the crank. You must put $a>b/2$ to avoid the collapse we saw above with $\sqrt{2}$.


So much for a repeat petiod of $3$, what about larger periods?

Claim: For any positive whole numbers $r$ there are at least an infinitude of $\sqrt{N}$ continued fractions having repeat period $r$ where $N$ is a whole number, having the following form:

$\sqrt{N}=[kP_r+1;\overline{2,2,...,2,2(kP_r+1)}]$

$P_r$ is a Pell number defined by $P_0=0,P_1=P_{-1}=1,P_r=2P_{r-1}+P_{r-2}\text{ for } r\ge 2$, and $k$ is a whole number $\ge 0$ for $r=1$, $\ge 1$ otherwise. The number of $2$ digits before the final entries is $r-1$.

The proof bears some similarities to calcukating the general solution for $r=3$ above. First add $kP_r+1$ to the expression to make a purely periodic fraction:

$x=kP_r+1+\sqrt{N}=[\overline{2(kP_r+1),2,2,...,2}]$

Then

$x=2(kP_r+1)+\dfrac{1}{[2,2,...,2,x]}$

By mathematical induction on $r$ and using the recursive relation defined for Pell numbers in the claim it is true that

$[2,2,...,2,x]=\dfrac{P_rx+P_{r-1}}{P_{r-1}x+P_{r-2}}$

with $r-1$ digits of $2$ in the block. When this is substituted into the previous equation the following is obtained:

$x=2(kP_r+1)+\dfrac{P_{r-1}x+P_{r-2}}{P_rx+P_{r-1}}$

$x=\dfrac{(2(kP_r+1)P_r+P_{r-1})x+2(kP_r+1)P_{r-1}+P_{r-2}}{P_rx+P_{r-1}}$

$(P_r)x^2-2(kP_r+1)P_rx-(2(kP_r+1)P_{r-1}+P_{r-2})=0$

Upon completing the square and back-substituting $\sqrt{N}=x-(P_rk+1)$ we obtain:

$N=\dfrac{(kP_r+1)^2P_r+2(kP_r+1)P_{r-1}+P_{r-2}}{P_r}$

Using the Pell number recursion to eliminste $P_{r-2}$:

$N=\dfrac{(kP_r+1)^2P_r+2(kP_r)P_{r-1}+P_r}{P_r}=(kP_r+1)^2+2kP_{r-1}+1$

thereby identifying $N$ as a whole number. For a full fundamental period $\ge 2$ the terminal element must not match the other elements, so in that case $k\ge 1$. Else (meaning a period of just $1$), $k$ may be any whole number, $k\ge 0$.


Just working numerically, $41$ is the least example, with $$\sqrt {41}=[6; \overline {2,2,12}]$$

here is a tabulated list of the periods of $\sqrt d$.

OEIS provides a list of $d$ for which the period is $3$, and that link provides a way of generating infinitely many examples.