1 Introduction and main theorem

Throughout this paper, let d be a non-square positive integer so that the minimal period \(\ell :=\ell (d)=2L\) of the continued fraction expansion

$$\begin{aligned} \sqrt{d}=[a_0,a_1,\dots , a_n,\dots ]=[a_0, \overline{a_1,\dots ,a_{L-1},a_{L},a_{L-1},\dots ,a_{1}, 2a_0}] \end{aligned}$$

is even and greater than 2. We call the sequence \(a_1,\dots ,a_{L-1},a_{L}\) the primary symmetric part of the continued fraction expansion of \(\sqrt{d}\). It is known that the partial quotients \(a_n\ (1\le n\le L)\) satisfy

$$\begin{aligned} a_n<\frac{2}{3}a_0\quad (1\le n\le L-1) \end{aligned}$$
(1.1)

and

$$\begin{aligned} a_L\le \frac{2}{3}a_0\quad {\mathrm{or}} \quad a_L\in \{a_0,a_0-1\} \end{aligned}$$

(see, for example, Perron [9, Satz 3.14]). Define \(\omega _0:=\sqrt{d}\) and \(\omega _{n+1}:=(\omega _{n}-[\omega _{n}])^{-1}\) for \(n\ge 0\); then \(a_{n}=[\omega _{n}]\), where \([\ \,]\) denotes the greatest integer function. Moreover, we can uniquely write \(\omega _n=(P_n+\sqrt{d})/Q_n\) with positive integers \(P_n\), \(Q_n\) for each \(n\ge 1\). Put \(\Delta :=4d\); then \(\Delta \) is a quadratic discriminant. Define

$$\begin{aligned} \mathcal {Q}_{\Delta }:=\{Q_1,\ldots ,Q_{L}\}. \end{aligned}$$
(1.2)

As we will state in Section 2, \(\mathcal {Q}_{\Delta }\) is the set which appears in a criterion for a real quadratic field \(\mathbb {Q}(\sqrt{\Delta })\) to have class number one (cf. Louboutin [7]). Furthermore, from the partial quotients \(a_{n}\ (n\ge 0)\), we define non-negative integers \(p_n, q_n, r_n\) by

$$\begin{aligned} {\left\{ \begin{array}{ll} \begin{aligned} &{}p_0=1,&{}&{}p_1=a_0,&{}&{}p_n=a_{n-1}p_{n-1}+p_{n-2}\ (n\ge 2),\\ &{}q_0=0,&{}&{}q_1=1,&{}&{}q_n=a_{n-1}q_{n-1}+q_{n-2}\ (n\ge 2),\\ &{}r_0=1,&{}&{}r_1=0,&{}&{}r_n=a_{n-1}r_{n-1}+r_{n-2}\ (n\ge 2). \end{aligned} \end{array}\right. } \end{aligned}$$

There are some relations between them and \(Q_n\) (cf. Lemma 2.1).

In the case where both of the conditions (c) and (d) below hold, it must hold that \(d\equiv 2,\,3\ (\mathrm{mod}\ 4)\) ([3, Theorem 2 (2)]). Thus, for any even positive integer \(\ell \), we consider the positive integer \(d_{\ell }'\) which is defined by

$$\begin{aligned} d_{\ell }':=\min \{d>0\,|\,\ell (d)=\ell ,\ d\equiv 2,\,3\ (\mathrm{mod}\ 4)\}. \end{aligned}$$

We have stated in our previous paper [3] that for any even integer \(\ell \) in the range \(8\le \ell \le 73478\), the following four conditions hold for \(d=d_{\ell }'\) without exception:

  1. (a)

    d is square-free.

  2. (b)

    The class number of \(\mathbb {Q}(\sqrt{d})\) is equal to 1.

  3. (c)

    d is a positive integer with period \(\ell \) of minimal type for \(\sqrt{d}\).

  4. (d)

    The primary symmetric part of the continued fraction expansion of \(\sqrt{d}\) is of \(\mathrm {ELE}\) type.

Here, let us state the definitions of “minimal type” and “\(\mathrm {ELE}\) type” in our situation.

For brevity, we put

$$\begin{aligned} A:=q_{\ell },\ B:=q_{\ell -1},\ C:=r_{\ell -1}, \end{aligned}$$

and define

$$\begin{aligned} g(x)=Ax-(-1)^{\ell }BC,\ h(x)=Bx-(-1)^{\ell }C^2,\ f(x)=g(x)^2+4h(x). \end{aligned}$$

Moreover, let \(s_0\) be the least integer for which \(g(s_0)>0\). Then d can be written uniquely as \( d=f(s)/4 \) with some integer \(s\ge s_0\) ([4, Theorem 3.1]).

Definition 1.1

([4, Definition 3.1]). Under the above setting, if \(s=s_0\), that is, \(d=f(s_0)/4\) holds, then we say that d is a positive integer with period\(\ell \)of minimal type for\(\sqrt{d}\).

By using \(q_{L-1},q_{L},q_{L+1}\) and \(r_{L-1},r_{L},r_{L+1}\), define integers \(u_1\), \(u_2\), w, \(v_1\), \(v_2\), z, \(\delta \) by

$$\begin{aligned} (r_{L}^2-(-1)^{L})(r_{L+1}+r_{L-1})&=q_Lv_1+u_1\ (0\le u_1<q_L),\\ (-1)^{L}(r_{L}-q_{L-1})r_{L}&=q_Lz+w\ (0\le w<q_L),\\ (-1)^{L}(q_{L}-r_{L+1})+z&=q_Lv_2+u_2\ (0\le u_2<q_L),\\ \delta&= {\left\{ \begin{array}{ll} 0 &{}\mathrm{if} \ u_1\le u_2,\\ 1 &{}\mathrm{if} \ u_1>u_2, \end{array}\right. } \end{aligned}$$

and put

$$\begin{aligned} \gamma&:=q_{L}(\delta q_{L}+u_2-u_1)+w,\\ \mu&:=\frac{1}{q_{L}}\{\gamma (q_{L+1}+q_{L-1})+2(q_{L-1}-r_{L})\}. \end{aligned}$$

Definition 1.2

([3, Definition 1.1]). Under the above setting, if either “\(a_L\ge 2\) and \(\mu =a_{L}\)” or “\(a_L\ge 4\) and \(\mu =a_{L}+2\)” holds, we say that the primary symmetric part \(a_1,a_2,\dots , a_L\) of the continued fraction expansion of \(\sqrt{d}\) is of ELE type.

In [3, Theorem 1], we proved theoretically that for a non-square positive integer d, if \(\ell (d)\) is even and greater than 4, we have

$$\begin{aligned} \mathrm{(c)} \ \text {and} \ \mathrm{(d)}\ \Longleftrightarrow \ Q_L=2\ \Longleftrightarrow \ a_L\in \{a_0,a_0-1\} \end{aligned}$$
(1.3)

except for \(d=19\,(=d_{6}')\).

Remark 1.1

For the exceptional case \(d=d_{6}'=19\), we have \(Q_L=2\), \(a_L=a_0-1\), and the conditions (a), (b), and (c) hold, but not (d) (cf. [3, Remark 1.1]).

From more numerical experiments, the authors have verified that all of the above four conditions (a)–(d) hold for \(d=d_{\ell }'\) for any even \(\ell \) in the range \(8\le \ell \le 83552\) without exception, and all of the following four conditions (e)–(h) hold for \(d=d_{\ell }'\) for any even \(\ell =2L\) in the range \(6\le \ell \le 83552\) except for \(\ell = 14\):

  1. (e)

    \(d\equiv 1\ (\mathrm{mod}\ 3)\).

  2. (f)

    \(\max \{a_1,\ldots ,a_{L-1}\}\) is equal to the largest integer less than \(2a_0/3\).

  3. (g)

    There is only one index \(k\ (1\le k\le L-1)\) such that \(a_k=\max \{a_1,\ldots ,a_{L-1}\}\).

  4. (h)

    \(3\in \{Q_1,\ldots ,Q_{L-1}\} \,(\subset \mathcal {Q}_{4d}=\mathcal {Q}_{\Delta })\).

Remark 1.2

To create the database necessary for our numerical experiment, we needed to calculate about 10 years using PARI/GP on a workstation equipped with Intel Xeon (R) X5550 dual processor. We think that if multiple devices equipped with recent processors are used, the database could be created in shorter time. We have performed this verification using the created database and Math::Pari the library of Perl. If the database is prepared on a solid-state drive, the verification time takes about 10 hours or less.

The aim of this paper is to prove the following theorem which gives some relations between the above conditions:

Theorem 1

Under the above setting, assume that the minimal period \(\ell =\ell (d)\) is greater than 4.

  1. (1)

    The conditions (f) and (h) are equivalent.

  2. (2)

    Suppose that both of the conditions (c) and (d) hold. If either the conditions (f) or (h) holds, then (g) holds.

  3. (3)

    Assume that \(d\equiv 2,3\ (\mathrm{mod}\ 4)\) and both of the conditions (a) and (b) hold. Then (c) and (d) hold except for the case \(d=19\). Moreover, the conditions (e) and (h) are equivalent.

Remark 1.3

For the exceptional case \(\ell =14\), we have \(d_{14}'=134\equiv 2\ (\mathrm{mod}\ 3)\). Put \(\Delta :=4\cdot 134\). Then \(L=7\), \(2a_0/3=7+(1/3)\), \(\langle a_1,\dots ,a_{L-1}\rangle =\langle 1,1,2,1,3,1\rangle \), \(\mathcal {Q}_{\Delta }=\{13,10,7,14,5,17,2\}\), and none of the conditions (e), (f), and (h) holds. Moreover, we can verify that the conditions (c), (d), and (g) hold, so this is a counter-example to the converse of Theorem 1 (2).

2 Preliminaries

First we review a part of the works of Perron [9] and Halter-Koch [2].

Lemma 2.1

Under the above setting, the following holds:

  1. (1)

    \(P_{n}+P_{n+1}=a_nQ_n\ (n\ge 0)\) ([9, §20, (10), p.69], [2, Theorem 2.2.6.1.b]).

  2. (2)

    \(Q_nQ_{n+1}=d-P_{n+1}^2\ (n\ge 0)\) ([9, §20, (11), p.69], [2, Theorem 2.2.6.1.c]).

  3. (3)

    Suppose that \(1\le n\le \ell -1\). Then \(P_{n+1}=P_{n}\) if and only if \(\ell =2n\) ([9, §25, Satz 3.11, p.82], [2, Theorem 2.3.5.6]).

  4. (4)

    \(Q_{n}\ge 3\ (1\le n\le L-1)\) ([9, §25, Satz 3.13, p.84]).

  5. (5)

    \(a_nQ_{n}\le 2a_0\ (1\le n\le \ell -1)\) ([9, §25, (8), p.85], [4, Lemma 2.2]).

  6. (6)

    \((-1)^nQ_n=p_n^2-dq_n^2\ (n\ge 0)\) ([9, §27, (2), p.92], [2, Theorem 2.3.5.1.e]).

  7. (7)

    \(q_{\ell }=q_{L}(q_{L+1}+q_{L-1})\) ([5, (3.2)], [2, Theorem 2.3.5.6.b]).

  8. (8)

    \(p_{L}=Q_{L}(q_{L+1}+q_{L-1})/2\) ([5, (3.5)], [2, Theorem 2.3.5.6.a]).

Now, let us prove the following proposition.

Proposition 2.1

Under the above setting, let c be the largest integer less than \(2a_0/3\) and assume \(d\ne 14\). For \(1\le k\le L-1\), \(Q_k=3\) if and only if \(c=a_k=\max \{a_1,\ldots ,a_{L-1}\}\).

Proof

We note that

$$\begin{aligned} a_0<\sqrt{d}<a_0+1; \quad a_k<\omega _k<a_{k}+1. \end{aligned}$$

Assume that \(Q_k=3\) for some \(k,\, 1\le k\le L-1\). Since \(\omega _k=(P_k+\sqrt{d})/Q_{k}\) is reduced ([2, Theorems 2.3.5, 2.2.2.2]) and \(Q_k=3\), we have

$$\begin{aligned} -1<\frac{P_k-\sqrt{d}}{3} \end{aligned}$$

and \(\sqrt{d}-3<P_k\). Since \(a_0<\sqrt{d}\), we have \(a_0-3<P_k\) and

$$\begin{aligned} a_0-2\le P_k. \end{aligned}$$
(2.1)

Hence,

$$\begin{aligned} 2a_0-2<a_0-2+\sqrt{d}\le P_k+\sqrt{d}=3\omega _k<3(a_{k}+1) \end{aligned}$$

and \(2a_0-1\le 3(a_{k}+1)\). Hence,

$$\begin{aligned} \frac{2}{3}a_0\le a_k+\frac{4}{3}. \end{aligned}$$
(2.2)

On the other hand, inequality (1.1) leads to

$$\begin{aligned} a_k<\frac{2}{3}a_0. \end{aligned}$$
(2.3)

By (2.2) and (2.3), therefore, we obtain

$$\begin{aligned} a_k<\frac{2}{3}a_0\le a_k+\frac{4}{3} \end{aligned}$$

and

$$\begin{aligned} 2a_0=3a_k+\delta \end{aligned}$$
(2.4)

for some \(\delta \in \{1,2,3,4\}\). If \(\delta \not =4\), then \(a_k<2a_0/3\le a_k+1\) and \(c=a_k\). Then by (1.1), we get

$$\begin{aligned} a_k=\max \{a_1,\ldots ,a_{L-1}\}. \end{aligned}$$

Now, we prove \(\delta \not =4\).

In the case \(2\not \mid a_k\), we easily see \(\delta \not =4\) by taking (2.4) modulo 2.

Next, let us create a contradiction by assuming that \(2\mid a_k\) and \(\delta =4\). Putting \(a_k=2t\) with some \(t\in \mathbb {N}\), we have

$$\begin{aligned} a_0=3t+2 \end{aligned}$$

by (2.4). Then by \(a_0<\sqrt{d}\), \(\omega _k<a_k+1\), and \(Q_k=3\), we have

$$\begin{aligned} \frac{P_k+3t+2}{3}=\frac{P_k+a_0}{3}<\frac{P_k+\sqrt{d}}{3}=\omega _k<a_k+1=2t+1 \end{aligned}$$

and \(P_k<3t+1\). Hence,

$$\begin{aligned} P_k\le 3t. \end{aligned}$$
(2.5)

On the other hand, it follows from (2.1) that

$$\begin{aligned} 3t\le P_k. \end{aligned}$$
(2.6)

By (2.5) and (2.6), we get \(P_k= 3t\). Thus, we see from Lemma 2.1 (1) that

$$\begin{aligned} P_{k+1}=a_kQ_k-P_{k}=2t\cdot 3-3t=3t=P_k. \end{aligned}$$

Then by Lemma 2.1 (3), we get \(k=L\), which is a contradiction.

Conversely, we assume \(c=a_k\), where \(a_k:=\max \{a_1,\ldots ,a_{L-1}\}\). Then the inequalities \(a_k<2a_0/3\le a_k+1\) hold. Hence, by Lemma 2.1 (5), we have

$$\begin{aligned} a_{k}+1\ge \frac{2}{3}a_0\ge \frac{a_kQ_k}{3}. \end{aligned}$$
(2.7)

Now we suppose that \(Q_k\ge 4\). Then (2.7) implies that \(3\ge a_k\) and

$$\begin{aligned}{}[\sqrt{d}]=a_0\le \frac{3}{2}(a_k+1)\le \frac{3}{2}(3+1)=6. \end{aligned}$$

Thus we obtain \(d<7^2\). Therefore, if \(d\ge 7^2=49\), then \(Q_k\le 3\), and \(Q_k=3\) by Lemma 2.1 (4). Finally, there are only 16 positive integers \(d<49\) such that the minimal period \(\ell =\ell (d)\) is even and greater than 2. In each case, \(\ell \), \(a_0\), c, \(\langle a_1,\ldots ,a_{L-1}\rangle \), and \(Q_n\,(1\le n\le {L-1})\) are as follows:

d

\(\ell \)

\(a_0\)

c

\(\langle a_1,\ldots ,a_{L-1}\rangle \)

\(Q_1\)

\(Q_2\)

\(Q_3\)

\(Q_4\)

\(Q_5\)

7

4

2

1

\(\langle 1\rangle \)

3

    

14

4

3

1

\(\langle 1\rangle \)

5

    

19

6

4

2

\(\langle 2,1\rangle \)

3

5

   

21

6

4

2

\(\langle 1,1\rangle \)

5

4

   

22

6

4

2

\(\langle 1,2\rangle \)

6

3

   

23

4

4

2

\(\langle 1\rangle \)

7

    

28

4

5

3

\(\langle 3\rangle \)

3

    

31

8

5

3

\(\langle 1, 1, 3\rangle \)

6

5

3

  

32

4

5

3

\(\langle 1\rangle \)

7

    

33

4

5

3

\(\langle 1\rangle \)

8

    

34

4

5

3

\(\langle 1\rangle \)

9

    

43

10

6

3

\(\langle 1, 1, 3, 1\rangle \)

7

6

3

9

 

44

8

6

3

\(\langle 1,1,1\rangle \)

8

5

7

  

45

6

6

3

\(\langle 1,2\rangle \)

9

4

   

46

12

6

3

\(\langle 1, 3, 1, 1, 2\rangle \)

10

3

7

6

5

47

4

6

3

\(\langle 1\rangle \)

11

    

From this, we see that \(c=a_k\) if and only if \(d=7,14,19,22,28,31,43,46\), where \(k=1,1,1,2,1,3,3,2\), respectively. We easily verify that \(Q_k=3\) except for \(d=14\). This completes the proof. \(\square \)

Next we review the fundamental properties of orders of real quadratic fields (cf. [2]). Let \(\Delta _{K}\) be the discriminant of the real quadratic field \(K:=\mathbb {Q}(\sqrt{\Delta })\). Then there is a unique positive integer \(f_{\Delta }\) such that \(\Delta =\Delta _{K}f_{\Delta }^2\) ([2, Theorem 1.1.6.2]). We call \(f_{\Delta }\) the conductor of \(\Delta \). Moreover, we define the quadratic order\(\mathcal {O}_{\Delta }\) with discriminant \(\Delta \) by

$$\begin{aligned} \mathcal {O}_{\Delta } :=\mathbb {Z}+\mathbb {Z}\frac{\sqrt{\Delta }}{2} =\mathbb {Z}+\mathbb {Z}\sqrt{d}. \end{aligned}$$

Here we note that \(\Delta =4d\) in our situation.

For the generators of the unit group \(\mathcal {O}_{\Delta }^{\times }\), the following holds:

Proposition 2.2

([2, Theorems 2.2.9.2, 2.3.5.4, 5.2.1.2]). Let \(\Delta ,\omega _n,p_{n},q_{n}\,(n\ge 0)\) be as above, and put

$$\begin{aligned} \varepsilon _{\Delta }:=\prod \limits _{n=1}^{\ell }\omega _n \ (>1). \end{aligned}$$

Then we have \( \mathcal {O}_{\Delta }^{\times }=\langle -1, \varepsilon _{\Delta }\rangle \) and \( \varepsilon _{\Delta }^k=p_{k\ell }+q_{k\ell }\sqrt{d} \) for any \(k\ge 0\).

For a non-zero ideal \(\mathfrak {a}\) of \(\mathcal {O}_{\Delta }\), we denote the absolute norm of \(\mathfrak {a}\) by

$$\begin{aligned} N_{\Delta }(\mathfrak {a}):=(\mathcal {O}_{\Delta } : \mathfrak {a}). \end{aligned}$$

Regarding the ideal decomposition, let us introduce the following three propositions.

Proposition 2.3

([2, Theorem 5.8.1]). Let \(\mathfrak {a}\) be a non-zero ideal of \(\mathcal {O}_{\Delta }\) with \((N_{\Delta }(\mathfrak {a}),f_{\Delta })=1\). Then \(\mathfrak {a}\) can be written as a product of prime ideals of \(\mathcal {O}_{\Delta }\) in a unique way.

Proposition 2.4

([2, Theorem 5.8.8]). For a quadratic discriminant \(\Delta >0\) and a prime p, define the Kronecker symbol \(\chi _{\Delta }\) using the Legendre symbol by

$$\begin{aligned} \chi _{\Delta }(p):= {\left\{ \begin{array}{ll} \left( \dfrac{\Delta }{p}\right) \quad &{} \text {if } p\not \mid \Delta \ \text {and} \ p\ne 2, \\ (-1)^{(\Delta ^2-1)/8} \quad &{} \text {if } p\not \mid \Delta \ \text {and} \ p=2, \\ 0 \quad &{} \text {if } p\mid \Delta . \end{array}\right. } \end{aligned}$$
  1. (1)

    If \(\chi _{\Delta }(p)=1\), then there are only two prime ideals \(\mathfrak {p}\) and \(\mathfrak {p}'\) of \(\mathcal {O}_{\Delta }\) containing p, which satisfy \(p\mathcal {O}_{\Delta }=\mathfrak {p}\mathfrak {p}'\), \(\mathfrak {p}\ne \mathfrak {p}'\), and \(N_{\Delta }(\mathfrak {p})=N_{\Delta }(\mathfrak {p}')=p\).

  2. (2)

    If \(\chi _{\Delta }(p)=-1\), then \(p\mathcal {O}_{\Delta }\) is the only prime ideal of \(\mathcal {O}_{\Delta }\) containing p.

  3. (3)

    If \(\chi _{\Delta }(p)=0\), then there is a unique prime ideal \(\mathfrak {p}\) of \(\mathcal {O}_{\Delta }\) containing p. Moreover, if \(p\not \mid f_{\Delta }\), then we have \(p\mathcal {O}_{\Delta }=\mathfrak {p}^2\) and \(N_{\Delta }(\mathfrak {p})=p\).

Remark 2.1

For any prime p, the value of \(\chi _{\Delta }(p)\) coincides with the one of the quadratic symbol \(Q_{\Delta }(p)\), as in [2, Theorem 5.8.8].

Proposition 2.5

([2, Theorem 2.3.5.3]). Let \(p_{n},q_{n}\, (n\ge 0)\) be as above. Then we have

$$\begin{aligned} p_{n+k\ell }-q_{n+k\ell }\sqrt{d} =(p_{n}-q_{n}\sqrt{d})(p_{\ell }-q_{\ell }\sqrt{d})^k \end{aligned}$$

for any \(n\ge 1\), \(k\ge 0\).

Now, we can prove the following proposition.

Proposition 2.6

Let the notation be as above. For \(1\le n\le L-1\), assume that \(Q_{n}\) is a prime greater than \(Q_L\). Then we have \(Q_{n_1}\ne Q_{n}\) for any \(n_1\ne n,\, 1\le n_1\le L-1\).

Proof

For brevity, we put \(p:=Q_{n}\). By Lemma 2.1 (4), we note that \(p\ge 3\). Suppose that \(p\mid f_{\Delta }\). Then we have \(p^2\mid \Delta _{K}f_{\Delta }^2=\Delta =4d\), and hence \(p^2\mid d\). By Lemma 2.1 (6), we obtain the congruence

$$\begin{aligned} (-1)^np=(-1)^nQ_n=p_n^2-dq_n^2\equiv p_n^2 \ (\mathrm{mod}\ p^2), \end{aligned}$$

which is impossible. Thus we get \(p\not \mid f_{\Delta }\). Since \(N_{\Delta }(p\mathcal {O}_{\Delta })=p^2\) is coprime to \(f_{\Delta }\), it follows from Proposition 2.3 that \(p\mathcal {O}_{\Delta }\) can be written as a product of prime ideals of \(\mathcal {O}_{\Delta }\) in a unique way.

Let \(n_1\ne n, \, 1\le n_1\le L-1\). Without loss of generality, we can assume that \(n_1<n\). Now we will create a contradiction by assuming that \(Q_{n_1}=Q_{n}\).

  1. (I)

    The case where \(p\not \mid \Delta =4d\). Noting that \(Q_{n}=p\not =2\), we have \(d\equiv P_{n+1}^2\ (\mathrm{mod}\ p)\) by Lemma 2.1 (2) and

    $$\begin{aligned} \chi _{\Delta }(p)=\left( \dfrac{4d}{p}\right) =\left( \dfrac{d}{p}\right) =1. \end{aligned}$$

    Hence by Proposition 2.4, we have the decomposition

    $$\begin{aligned} p\mathcal {O}_{\Delta }=\mathfrak {p}\mathfrak {p}', \ \mathfrak {p}\ne \mathfrak {p}', \ N_{\Delta }(\mathfrak {p})=N_{\Delta }(\mathfrak {p}')=p. \end{aligned}$$

    On the one hand, by putting \(\alpha :=p_n+q_n\sqrt{d}\) and \(\alpha ':=p_n-q_n\sqrt{d}\), it follows from Lemma 2.1 (6) that \((-1)^np=\alpha \alpha '\), and so \(p\mathcal {O}_{\Delta } =(\alpha \mathcal {O}_{\Delta })(\alpha '\mathcal {O}_{\Delta })\). Now we let \(\mathfrak {p}=\alpha \mathcal {O}_{\Delta }\). Then \(\mathfrak {p}'=\alpha '\mathcal {O}_{\Delta }\). On the other hand, by putting \(\beta :=p_{n_1}+q_{n_1}\sqrt{d}\) and \(\beta ':=p_{n_1}-q_{n_1}\sqrt{d}\), we get \((-1)^{n_1}p=(-1)^{n_1}Q_{n_1}=\beta \beta '\) similarly. Then we obtain \(p\mathcal {O}_{\Delta } =(\beta \mathcal {O}_{\Delta })(\beta '\mathcal {O}_{\Delta })\). By the uniqueness of the decomposition into prime ideals, we have \(\beta \mathcal {O}_{\Delta }=\mathfrak {p} \ (=\alpha \mathcal {O}_{\Delta })\) or \(\beta '\mathcal {O}_{\Delta }=\mathfrak {p}\). Thus, there is \(\eta \in \mathcal {O}_{\Delta }^{\times }\) such that

    $$\begin{aligned} p_{n_1}\pm q_{n_1}\sqrt{d}=(p_n+q_n\sqrt{d})\eta . \end{aligned}$$

    By Proposition 2.2, we can express \(\eta =\pm \varepsilon _{\Delta }^k\) for some integer k.

  2. (I-A)

    Assume that \(k\ge 0\). Then by Propositions 2.2 and 2.5, we have

    $$\begin{aligned} p_{n_1}\pm q_{n_1}\sqrt{d} =\pm (p_{n}+q_{n}\sqrt{d})(p_{\ell }+q_{\ell }\sqrt{d})^k =\pm (p_{n+k\ell }+q_{n+k\ell }\sqrt{d}), \end{aligned}$$

    and hence, \(p_{n_1}=\pm p_{n+k\ell }\). Since \(p_{n_1}>0\) and \(p_{n+k\ell }>0\), it must hold that \(p_{n_1}=p_{n+k\ell }\). Since the sequence \(\{p_{n}\}_{n\ge 1}\) is strictly monotonically increasing, we have \(n_1=n+k\ell \). Then by \(n_1\le L-1<2L=\ell \), we get \(k=0\), and hence, \(n_1=n\). This is a contradiction.

  3. (I-B)

    Next, we consider the case \(k<0\). Then by (I-A), we have

    $$\begin{aligned} (p_{n_1}\pm q_{n_1}\sqrt{d})\varepsilon _{\Delta }^{-k}=\pm (p_n+q_n\sqrt{d}), \quad -k>0. \end{aligned}$$

    Assume that the sign on the left hand side is \(+\). By a similar argument as in (I-A), we have

    $$\begin{aligned} p_{n_1+(-k)\ell }+q_{n_1+(-k)\ell }\sqrt{d}=\pm (p_n+q_n\sqrt{d}), \end{aligned}$$

    and hence, \(p_{n_1+(-k)\ell }=\pm p_n\). Thus we get \(p_{n_1+(-k)\ell }=p_n\). Since the sequence \(\{p_{n}\}_{n\ge 1}\) is strictly monotonically increasing, we obtain \(n=n_1+(-k)\ell \ge n_1+\ell >\ell \), which is a contradiction. Therefore, the sign on the left hand side must be − and we have

    $$\begin{aligned} (p_{n_1}-q_{n_1}\sqrt{d})\varepsilon _{\Delta }^{-k}=\pm (p_n+q_n\sqrt{d}). \end{aligned}$$

    Multiplying both sides by \(p_{n_1}+q_{n_1}\sqrt{d}\), we obtain

    $$\begin{aligned} (-1)^{n_1}p\varepsilon _{\Delta }^{-k} =\pm (p_n+q_n\sqrt{d})(p_{n_1}+q_{n_1}\sqrt{d}). \end{aligned}$$

    Then by Proposition 2.2, we obtain

    $$\begin{aligned} \quad \qquad (-1)^{n_1}p(p_{-k\ell }+q_{-k\ell }\sqrt{d}) =\pm \{(p_np_{n_1}+dq_nq_{n_1})+(p_nq_{n_1}+p_{n_1}q_n)\sqrt{d})\}. \end{aligned}$$

    Hence, \((-1)^{n_1}=\pm 1\) and

    $$\begin{aligned} p\cdot q_{-k\ell }=p_nq_{n_1}+p_{n_1}q_n. \end{aligned}$$

    From the assumption \(n_1<n\), we have

    $$\begin{aligned} p\cdot q_{\ell }\le p\cdot q_{-k\ell }<p_{n}q_{n}+p_{n}q_{n}=2p_{n}q_{n}. \end{aligned}$$
    (2.8)

    On the other hand, by using (7), (8) of Lemma 2.1 and the assumption \(p>Q_L\), we have

    $$\begin{aligned} 2p_Lq_L=Q_L(q_{L+1}+q_{L-1})q_L=Q_Lq_{\ell }<p\cdot q_{\ell }. \end{aligned}$$
    (2.9)

    By (2.8) and (2.9), we have \(p_{L}q_{L}<p_{n}q_{n}\), which contradicts \(L>n\).

  4. (II)

    The case where \(p\mid \Delta \). Since \(\chi _{\Delta }(p)=0\) and \(p\not \mid f_{\Delta }\), we have the decomposition

    $$\begin{aligned} p\mathcal {O}_{\Delta }=\mathfrak {p}^2, \ N_{\Delta }(\mathfrak {p})=p \end{aligned}$$

    by Proposition 2.4. By putting \(\alpha :=p_n+q_n\sqrt{d}\) and \(\alpha ':=p_{n}-q_{n}\sqrt{d}\), it follows from Lemma 2.1 (6) that \((-1)^np=\alpha \alpha '\), and so \(p\mathcal {O}_{\Delta } =(\alpha \mathcal {O}_{\Delta })(\alpha '\mathcal {O}_{\Delta })\). We let \(\mathfrak {p}=\alpha \mathcal {O}_{\Delta }\). Then by the uniqueness of the decomposition into prime ideals, we have \(\alpha '\mathcal {O}_{\Delta }=\mathfrak {p}'=\mathfrak {p}\). On the other hand, by putting \(\beta :=p_{n_1}+q_{n_1}\sqrt{d}\) and \(\beta ':=p_{n_1}-q_{n_1}\sqrt{d}\), we get \(p\mathcal {O}_{\Delta } =(\beta \mathcal {O}_{\Delta })(\beta '\mathcal {O}_{\Delta })\) similarly. Hence, also by the uniqueness of the decomposition into prime ideals, we have

    $$\begin{aligned} \beta \mathcal {O}_{\Delta }=\mathfrak {p}=\mathfrak {p}' =\alpha \mathcal {O}_{\Delta }. \end{aligned}$$

    Thus, there exist some \(\eta \in \mathcal {O}_{\Delta }^{\times }\) and \(k\in \mathbb {Z}\) such that

    $$\begin{aligned} p_{n_1}+q_{n_1}\sqrt{d}=(p_n+q_n\sqrt{d})\eta ,\quad \eta =\pm \varepsilon _{\Delta }^k. \end{aligned}$$

    By the same argument as in (I-A) and the first half of (I-B), we get respectively \(n_1=n\) and \(n>\ell \), which is a contradiction. The proof is now completed. \(\square \)

In the final part of this section, we introduce a result of Louboutin. Let \(h_{\Delta }\) denote the class number of the real quadratic order \(\mathcal {O}_{\Delta }\) with discriminant \(\Delta \) (cf. [2, Theorem 5.5.8]).

Theorem 2

([7, Theorem 3]). Under the above setting, assume that d is a square-free positive integer with \(d\equiv 2,3\ (\mathrm{mod}\ 4)\) and put \(K:=\mathbb {Q}(\sqrt{\Delta })\). Then we have \(f_{\Delta }=1, \Delta =\Delta _K\), and \(h_{\Delta }\) coincides with the class number of K. Furthermore, define the set \(\mathcal {S}_{\Delta }\) by

$$\begin{aligned} \mathcal {S}_{\Delta }:=\{p \,|\,p \ \text {is a prime},\ \chi _{\Delta }(p)\not =-1, \ p<\sqrt{\Delta }/2 \}. \end{aligned}$$

Then we have

$$\begin{aligned} h_{\Delta }=1\ \Longleftrightarrow \ \mathcal {S}_{\Delta }\subset \mathcal {Q}_{\Delta }, \end{aligned}$$

where \(\mathcal {Q}_{\Delta }\) is defined as in (1.2).

3 Proof of Theorem 1

Proof of (1) of Theorem 1

The assertion is given by Proposition 2.1 immediately. \(\square \)

Proof of (2) of Theorem 1

Assume that both of (c) and (d), and at least one of (f) and (h) hold. Since \(\ell (d)\ge 6\), we have \(d\ne 14\) (cf. the proof of Proposition 2.1). Then by Proposition 2.1, there exists some \(k,\, 1\le k\le L-1\), such that

$$\begin{aligned} a_k=\max \{a_1,\ldots ,a_{L-1}\}\ \text {and}\ Q_{k}=3. \end{aligned}$$

On the other hand, it follows from (1.3) that \(Q_L=2\). Since 3 is a prime number and \(3>2=Q_L\), the uniqueness of k follows from Proposition 2.6. Thus the condition (g) holds. \(\square \)

Proof of (3) of Theorem 1

Assume that \(d\equiv 2,3\ (\mathrm{mod}\ 4)\) and both of the conditions (a) and (b) hold. From assumptions (a) and (b) and genus theory, d is of the form \(d = q, 2q, q_1q_2, p\), or 2, where \(q,q_i\equiv 3\ (\mathrm{mod}\ 4)\) and \(p\equiv 1\ (\mathrm{mod}\ 4)\) are primes (cf. [2, Theorem 5.6.13.4]). Since \(d\equiv 2,\,3\ (\mathrm{mod}\ 4)\) and \(\ell (d)>1\), d must be of the form \(d=q,2q\). Golubeva [1, Proof of Corollary 2] (resp. Kubo [6, Theorem A], Louboutin [8, Lemma 3]) proved that if \(d=q\) (resp. \(d = 2q\)), then \(Q_{L}=2\) holds. Hence by (1.3), if \(d\ne 19\), then both of the conditions (c) and (d) hold. Moreover, we note that \(3\not \mid d\), so \(3\not \mid \Delta \) since we have \(d\ge 19\) as \(\ell \ge 6\) (cf. the proof of Proposition 2.1) and d is of the form \(d=q,2q\).

Next, we assume that the condition (e) holds. Then by \(3\not \mid \Delta \), we have

$$\begin{aligned} \chi _{\Delta }(3)=\left( \dfrac{\Delta }{3}\right) =\left( \dfrac{d}{3}\right) =1\not =-1. \end{aligned}$$

Moreover, we have \(3<\sqrt{d}=\sqrt{\Delta }/2\). Hence \(3\in \mathcal {S}_{\Delta }\). The assumptions (a) and (b) imply, by Theorem 2, that \( \mathcal {S}_{\Delta }\subset \mathcal {Q}_{\Delta }. \) Therefore, we get \(3\in \mathcal {Q}_{\Delta }\). Since \(Q_{L}=2\), we have \(3\in \{Q_1,\ldots ,Q_{L-1}\}\), that is, the condition (h) holds.

Conversely, we assume that the condition (h) holds. By Lemma 2.1 (2), we have \(d\equiv P_{k+1}^2\ (\mathrm{mod}\ 3)\) for some \(k,\, 1\le k\le L-1\). From this together with \(3\not \mid d\), we easily see that the condition (e) holds. \(\square \)

4 Remarks and examples

We give an example showing that the indices of \(\max \{a_1,\dots ,a_{L-1}\}\) and \(\min \{Q_1,\ldots ,Q_{L-1}\}\) do not always coincide with each other in the case where the condition (f) does not hold. Let \(d=858854366\equiv 2\ (\mathrm{mod}\ 4)\). Then we have

$$\begin{aligned} \sqrt{858854366}=[29306, \overline{4,1, 1, 1,1,8, 1, 3,1,4,9, 29306,9,4,1,3,1,8,1,1,1,1,4,58612}] \end{aligned}$$

and \(Q_n\,(1\le n\le {11})\) are as follows:

n

1

2

3

4

5

6

7

8

9

10

11

\(Q_n\)

12730

30769

25189

23890

33367

6235

42503

12470

39077

11945

6365

From these, we see that \(a_{11}=\max \{a_1,\ldots ,a_{L-1}\}\), \(Q_6=\min \{Q_1,\ldots ,Q_{L-1}\}\), and (f) does not hold. We can also verify that both of the conditions (c) and (d) hold.

Example 4.1

For each even \(\ell ,\, 6\le \ell \le 83552\) except for \(\ell =14\), as we have stated in Section 1, \(\max \{a_1,\ldots ,a_{L-1}\}\) is equal to the largest integer less than \(2a_0/3\) for \(d=d'_\ell \). In Table 1, we list the minimal element \(d_{\ell }'\) with period \(\ell \), the largest integer c less than \(2a_0/3\), and a part of the partial quotients \(\langle a_1,\ldots ,a_{L-1}\rangle \) of the continued fraction expansion of \(\sqrt{d_{\ell }'}\) for each even integer \(\ell \) with \(6\le \ell \le 32\). We can observe that the maximal elements in \(\{a_1,\ldots ,a_{L-1}\}\), which are underlined in the table, coincide with c except for \(\ell =14\).

Table 1 A part of the partial quotients of the continued fraction expansion of \(\sqrt{d_{\ell }'}\)