<s>[INST] Simple continued fraction of $\sqrt{d}$ with period of shortest length $3$ This is the problem:

Does there exist positive integer $d$ ( which is not a perfect square )  such that the length of the least period in the simple continued fraction of $\sqrt{d}$ is $3$? 

Consider the following theorem

Theorem : If the positive integer $d$ is not a perfect square, the simple continued fraction of $\sqrt{d}$ has the form $\sqrt{d} = [a_0;\overline{a_1,a_2,\cdots,a_{r-1},2a_o}]$ with $a_o = \lfloor d \rfloor$. Here $r$ denotes the length of the least period in the expansion of $\sqrt{d}$. Where $\lfloor x \rfloor$ denotes the greatest integer function/ floor function of $x$. 

We want to solve for non-square $d$ where$\sqrt{d} = [a_0;\overline{a_1,a_2,2a_o}]$, and $a_o = \lfloor d \rfloor$. Since $d$ is a positive integer, $a_o = \lfloor d \rfloor \ge 1$, and $a_1 , a_2$ are positive integers by definition. Please note that the converse of the above theorem is not true, for example, consider $[1;\overline{1,1,2}] = \sqrt{10}/2$ and $[0;\overline{1,1,0}] = \sqrt{2}/2$. I calculated first few continued fractions for $\sqrt{d}$, $$\begin{array}{c|c|c} \sqrt{d} & \text{Continued fraction} & r\\ \hline
√2 & [1;\bar{2}] & 1 \\
√3 & [1;\overline{1,2}] & 2 \\
√5 & [2;\bar{4}] & 1\\
√6 & [2;\overline{2,4}] & 2\\
√7 & [2;\overline{1,1,1,4}] & 4\\
√8 & [2;\overline{1,4}] & 2\\
√10 & [3;\bar{6}] & 1\\
√11 & [3;\overline{3,6}] & 2\\
√12 & [3;\overline{2,6}] & 2\\
√13 & [3;\overline{1,1,1,1,6}] & 5\\
√14 & [3;\overline{1,2,1,6}] & 4\\
√15 & [3;\overline{1,6}] & 2\\
√17 & [4;\bar{8}] & 1\\
√18 & [4;\overline{4,8}] & 2\\
√19 & [4;\overline{2,1,3,1,2,8}] & 6 \\
√20 & [4;\overline{2,8}] & 2\\
√21 & [4;\overline{1,1,2,1,1,8}] & 6\\
√22 & [4;\overline{1,2,4,2,1,8}] & 6\\
√23 & [4;\overline{1,3,1,8}] & 4\\
√24 & [4;\overline{1,8}] & 2\\ \end{array}$$
As we can see for $1< d \le 24, r \ne 3$. Also, on a side note, observe that  there does not exist two consecutive intergers $d$ and $d+1$ such that both $\sqrt{d}$ and $\sqrt{d+1}$ have $r=1$, moreover there are infinitely $\sqrt{d}$ such that the length of there least period is $1$ or $2$, $\sqrt{n^2+1} = [n;\overline{2n}]$, $\sqrt{n^2+2} = [n;\overline{n,2n}]$ and
$\sqrt{n^2-1} = [n-1;\overline{1,2(n-1)}]$ ,  where $n \in \mathbb{N}$ .Even for $r=4$, we have $\sqrt{n^2-2} = [n-1; \overline{1,n-2,1,2(n-1)}]$, $n>2$. Now i have a hunch that no such $d$ exists for which $\sqrt{d}$ have $r=3$. Any hints on how to prove this ?  In general does there exist a number $m$ such that $r\ne m $ for any $\sqrt{d}$ ?
 [/INST] 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.
</s>