1 Introduction

Let P and Q be nonzero integers. Lucas sequence of first kind \(\left( U_{n}\left( P,Q\right) \right) \) and Lucas sequence of second kind \(\left( V_{n}\left( P,Q\right) \right) ,\) with parameters P and Q,  are defined as follows:

$$\begin{aligned} U_{0}\left( P,Q\right)= & {} 0,\text { }U_{1}\left( P,Q\right) =1,\text { } U_{n+1}\left( P,Q\right) =PU_{n}\left( P,Q\right) \\&+QU_{n-1}\left( P,Q\right) \text { }(n\ge 1) \end{aligned}$$

and

$$\begin{aligned} V_{0}\left( P,Q\right)= & {} 2,\text { }V_{1}\left( P,Q\right) =P,\text { } V_{n+1}\left( P,Q\right) \!=\!PV_{n}\left( P,Q\right) \\&+ QV_{n-1}\left( P,Q\right) \text { }(n\ge 1). \end{aligned}$$

Lucas sequences of first and second kind for negative subscripts are defined as

$$\begin{aligned} U_{-n}=-(-Q)^{-n}U_{n}\left( P,Q\right) \text { and }V_{-n}=(-Q)^{-n}V_{n} \left( P,Q\right) \text { }(n\ge 1), \end{aligned}$$

respectively. Assume that \(P^{2}+4Q\ne 0.\) Explicitly, if \(\alpha =\left( P+ \sqrt{P^{2}+4Q}\right) /2\) and \(\beta =\left( P-\sqrt{P^{2}+4Q}\right) /2\) are the roots of \(x^{2}-Px-Q=0,\) then we have the following well-known expressions named Binet’s formula

$$\begin{aligned} U_{n}=U_{n}\left( P,Q\right) =(\alpha ^{n}-\beta ^{n})/(\alpha -\beta )\text { and }V_{n}=V_{n}\left( P,Q\right) =\alpha ^{n}+\beta ^{n} \end{aligned}$$

for all \(n\in \mathbb {Z} .\) Special cases of the sequences \((U_{n})\) and \((V_{n})\) are known under different names. The names under which they are known are Fibonacci, Pell, etc. When \(Q=-1,\) we present \((U_{n})\) and \((V_{n})\) by \(\left( U_{n}(P,-1)\right) \) and \(\left( V_{n}(P,-1)\right) ,\) respectively. For more information about Lucas sequences of first and second kind, see [1].

Investigations of the properties of second-order linear sequences have a very long history and literature. These investigations have given rise to questions concerning whether, for certain pairs \(\left( P,Q\right) , U_{n}\), or \(V_{n}\) is a square \(\left( =\square \right) \) or \(k\square .\) There are several results when the terms of these sequences are square. Now we summarize briefly the relevant known facts. In [2, 3], Cohn determined the square and twice the squares in \((U_{n})\) and \((V_{n})\) when P is odd and \(Q=\pm 1.\) Ribenboim and McDaniel [4] determined all indices n such that \(U_{n}=\square ,2U_{n}=\square , V_{n}=\square ,\) and \(2V_{n}=\square \) for all odd relatively prime integers P and Q. In [5], the same authors solved the equations \(V_{n}=3\square \) for \( P\equiv 1,3(\text{ mod } 8),Q\equiv 3(\text{ mod } 4), (P,Q)=1\) and solved the equation \(U_{n}=3\square \) for all odd relatively prime integers P and Q. Bremner and Tzanakis [6] extended the result of the equation \( U_{n}=\square \) by determining all sequence \((U_{n})\) with \(U_{12}=\square ,\) subject only to the restriction that \((P,Q)=1.\) In a later paper, the same authors [7] showed that for \(n=2,\ldots ,7\), \(U_{n}\) is a square for infinitely many coprime PQ and determined all sequences \((U_{n})\) with \( U_{n}=\square , n=8,10,11.\) And also in [8], they discussed the more general problem of finding all integers nPQ for which \(U_{n}=k\square \) for a given integer k. Cohn [9] dealt with the equations \(V_{n}=V_{m}\square \) and \(V_{n}=2V_{m}\square \) when P is odd and \(Q=1.\) McDaniel and Ribenboim [10] dealt with the equations \( V_{n}=V_{m}\square \) and \(U_{n}=U_{m}\square \) for general odd Q with \( (P,Q)=1.\) Şiar and Keskin [11], assuming \(Q = 1\), showed that there are no integer solutions to the equations \(V_{n}=3\square \) and \(V_{n}=6\square \) when P is odd and they also gave solutions to the equations \( V_{n}=3V_{m}\square \) and \(V_{n}=6V_{m}\square .\) In [12], when \( Q=1, \) Keskin and Karaatlı solved the equations \(U_{n}=5\square \) and \( U_{n}=5U_{m}\square \) under some assumptions on P. They solved the equations \(V_{n}=5\square \) with P odd and \(Q=1\) and they also showed that the equation \(V_{n}=5V_{m}\square \) has no solutions. Interested readers can also consult [11] or [12] to see the survey of such results.

In this study, using congruences, with extensive reliance upon the Jacobi symbol, we will solve the equations \(U_{n}=7\square ,V_{n}=7\square , U_{n}=7U_{m}\square ,\) and \(V_{n}=7V_{m}\square \) under the conditions that P is odd and \(Q=1.\) Our method of proof is similar to that presented by Cohn, McDaniel, and Ribenboim [24, 9].

2 Preliminary Facts, Some Lemmas, and Theorems

In this section, we state the necessary identities, lemmas, and theorems. Throughout the paper, unless otherwise stated, \(Q=1\) and mn are positive integers. Also, \(\left( \frac{*}{*}\right) \) will denote the Jacobi symbol. The proofs of the following four theorems can be found in [13].

Theorem 1

Let \(n\in \mathbb {N} \cup \left\{ 0\right\} , m,r\in \mathbb {Z}\) and m be a nonzero integer. Then

$$\begin{aligned} U_{2mn+r}\equiv \left( -1\right) ^{mn}U_{r}\text { }(\text{ mod }\text { }U_{m}), \end{aligned}$$
(2.1)
$$\begin{aligned} V_{2mn+r}\equiv \left( -1\right) ^{mn}V_{r}\text { }(\text{ mod }\text { }U_{m}). \end{aligned}$$
(2.2)

Theorem 2

Let \(n\in \mathbb {N} \cup \left\{ 0\right\} \) and \(m,r\in \mathbb {Z} .\) Then

$$\begin{aligned} U_{2mn+r}\equiv \left( -1\right) ^{(m+1)n}U_{r}\text { }(\text{ mod }\text { } V_{m}), \end{aligned}$$
(2.3)
$$\begin{aligned} V_{2mn+r}\equiv \left( -1\right) ^{(m+1)n}V_{r}\text { }(\text{ mod }\text { } V_{m}). \end{aligned}$$
(2.4)

The following congruences are valid for the numbers \(U_{n}=U_{n}(P,-1)\) and \( V_{n}=V_{n}(P,-1).\)

Theorem 3

Let \(n\in \mathbb {N} \cup \left\{ 0\right\} , m,r\in \mathbb {Z} \) and m be a nonzero integer. Then

$$\begin{aligned} U_{2mn+r}\equiv U_{r}\text { }(\text{ mod }\text { }U_{m}), \end{aligned}$$
(2.5)
$$\begin{aligned} V_{2mn+r}\equiv V_{r}\text { }(\text{ mod }\text { }U_{m}). \end{aligned}$$
(2.6)

Theorem 4

Let \(n\in \mathbb {N} \cup \left\{ 0\right\} \) and \(m,r\in \mathbb {Z} .\) Then

$$\begin{aligned} U_{2mn+r}\equiv \left( -1\right) ^{n}U_{r}\text { }(\text{ mod }\text { }V_{m}), \end{aligned}$$
(2.7)
$$\begin{aligned} V_{2mn+r}\equiv \left( -1\right) ^{n}V_{r}\text { }(\text{ mod }\text { }V_{m}). \end{aligned}$$
(2.8)

The following lemmas can be proved by using Theorems 1 and 2.

Lemma 5

$$\begin{aligned} 3|V_{n}\Leftrightarrow \left\{ \begin{array}{ll} n\equiv 1\text { }(\text{ mod }\text { }2)&{}\quad \text { if }3|P, \\ n\equiv 2\text { }(\text{ mod }\text { }4)&{}\quad \text { if }3\not \mid P. \end{array} \right. \end{aligned}$$

Lemma 6

$$\begin{aligned} 7|V_{n}\Leftrightarrow \left\{ \begin{array}{ll} 2\not \mid n&{}\quad {\text {if}}\;7|P, \\ 4|n\;{\text {and}}\;n/4\;{\text {{is}\; odd}}&{}\quad {\text {if}}\;P^{2}\equiv 1(\text{ mod } 7), \\ 4|n\;{\text {and}}\;n/4\;{\text {is\; odd}}&{}\quad {\text {if}}\;P^{2}\equiv 2(\text{ mod } 7), \\ 3|n\;{\text {and}}\;n\;{\text {is\; odd}}&{}\quad {\text {if}}\;P^{2}\equiv 4(\text{ mod } 7). \end{array} \right. \end{aligned}$$

Lemma 7

$$\begin{aligned} 7|U_{n}\Leftrightarrow \left\{ \begin{array}{ll} 2|n &{}\quad \text { if }7|P, \\ 8|n &{}\quad \text { if }P^{2}\equiv 1(\text{ mod } \text { }7), \\ 16|n &{}\quad \text { if }P^{2}\equiv 2(\text{ mod } \text { }7), \\ 6|n &{}\quad \text { if }P^{2}\equiv 4(\text{ mod } \text { }7). \end{array} \right. \end{aligned}$$

We state the following lemma without proof.

Lemma 8

All positive integer solutions to the equation \(x^{2}-7y^{2}=-3\) are given by \((x,y)=\left( 2U_{m+1}(16,-1)+5U_{m}(16,-1),U_{m+1}(16,-1)-2U_{m}(16,-1)\right) \) with \( m\ge 0\) or \((x,y)=\left( 5U_{m}(16,-1)+2U_{m-1}(16,-1),2U_{m}(16,-1)-U_{m-1}(16,-1)\right) \) with \( m\ge 1.\)

We omit the proofs of the following lemma, as it is based a straightforward induction.

Lemma 9

If n is even, then \(V_{n}\equiv 2 (\text{ mod } P^{2})\) and if n is odd, then \(V_{n}\equiv nP (\text{ mod } P^{2}).\)

The following theorem can be obtained from Theorem 11 given in [9].

Theorem 10

Let P be an odd integer, \(m\ge 1\) be an integer, and \( V_{n}=V_{m}x^{2}\) for some integer x. Then \(n=m\) or \(n=3, m=1, P=1.\)

Now we begin by listing the properties which will be used.

$$\begin{aligned} U_{2n}= & {} U_{n}V_{n}, \end{aligned}$$
(2.9)
$$\begin{aligned} V_{2n}= & {} V_{n}^{2}-2(-1)^{n}, \end{aligned}$$
(2.10)
$$\begin{aligned} V_{3n}= & {} V_{n}\left( V_{n}^{2}-3(-1)^{n}\right) , \end{aligned}$$
(2.11)
$$\begin{aligned} \text {If }P\text { is odd and }n\ge & {} 1,\text { then }2|V_{n}\Leftrightarrow 2|U_{n}\Leftrightarrow 3|n, \end{aligned}$$
(2.12)
$$\begin{aligned} \text {If }3|P,\text { then }V_{2^{r}}\equiv & {} 2\text { }(\text{ mod }\text { }3) \text { for all positive integer }r. \end{aligned}$$
(2.13)

Let \(m=2^{a}k,n=2^{b}l, k\) and l odd, \(a,b\ge 0,\) and \(d=(m,n).\) Then

$$\begin{aligned} (U_{m},V_{n})= & {} \left\{ \begin{array}{ll} V_{d}&{}\quad \text { if }a>b, \\ 1\text { or }2&{}\quad \text { if }a\le b. \end{array} \right. \end{aligned}$$
(2.14)
$$\begin{aligned} \text {If }r>1,\text { then }\left( \frac{U_{3}}{V_{2^{r}}}\right)= & {} 1, \end{aligned}$$
(2.15)
$$\begin{aligned} \text {If }V_{m}\ne & {} 1,\text { then }V_{m}|V_{n}\text { iff }m|n\text { and }n/m \text { is odd,} \end{aligned}$$
(2.16)
$$\begin{aligned} \text {If }U_{m}\ne & {} 1,\text { then }U_{m}|U_{n}\text { iff }m|n, \end{aligned}$$
(2.17)
$$\begin{aligned} V_{7n}= & {} \left\{ \begin{array}{ll} V_{n}\left( V_{2n}^{3}-V_{2n}^{2}-2V_{2n}+1\right) &{}\quad \text { if }n\text { is even,} \\ V_{n}\left( V_{2n}^{3}+V_{2n}^{2}-2V_{2n}-1\right) &{}\quad \text { if }n\text { is odd. } \end{array} \right. \end{aligned}$$
(2.18)

By using (2.10), we readily obtain from (2.18) that

$$\begin{aligned} V_{7n}=\left\{ \begin{array}{ll} V_{n}\left( V_{n}^{6}-7V_{n}^{4}+14V_{n}^{2}-7\right) &{}\quad \text { if }n\text { is even,} \\ V_{n}\left( V_{n}^{6}+7V_{n}^{4}+14V_{n}^{2}+7\right) &{}\quad \text { if }n\text { is odd.} \end{array} \right. \end{aligned}$$
(2.19)

If 7|P and n is odd, then \(7|V_{n}\) from Lemma 6 and therefore from (2.19), it follows that

$$\begin{aligned} V_{7n}=7V_{n}\left( 7a+1\right) . \end{aligned}$$
(2.20)

If P is odd, then \(V_{2^{r}}\equiv 3 (\text{ mod } 8)\) if \(r=1\) and \( V_{2^{r}}\equiv 7(\text{ mod }8)\) if \(r>1,\) which can be found in [4]. And so, it is clear that

$$\begin{aligned} \left( \frac{-1}{V_{2^{r}}}\right) =-1 \end{aligned}$$
(2.21)

for \(r\ge 1.\) Moreover,

$$\begin{aligned} V_{n}^{2}(P,-1)-(P^{2}-4)U_{n}^{2}(P,-1)=4. \end{aligned}$$
(2.22)

If P is even, then

$$\begin{aligned} \left. \begin{array}{c} U_{n}(P,-1)\text { is even}\Leftrightarrow n\text { is even,} \\ U_{n}(P,-1)\text { is odd}\Leftrightarrow n\text { is odd,} \\ V_{n}(P,-1)\text { is even for all }n\in \mathbb {N} .\text { } \end{array} \right. \end{aligned}$$
(2.23)

Properties between (2.11)–(2.18) can be found in [5, 14, 15]. The others are well known.

3 Main Theorems

In this section, we shall establish some theorems and lemmas which will be required later.

Theorem 11

The equation \(x^{4}-7y^{2}=-3\) has no positive integer solution.

Proof

Assume that \(x^{4}-7y^{2}=-3\) for some \(x,y>0.\) If y is odd, then it follows that \(x^{4}\equiv 4\left( \text{ mod }\text { }8\right) ,\) which is impossible. Thus, y is even and therefore x is odd. Note that the equation \(x^{4}-7y^{2}=-3\) implies that

$$\begin{aligned} (x^{2})^{2}-7y^{2}=-3. \end{aligned}$$

By Lemma 8, we get \(x^{2}=2U_{m+1}(16,-1)+5U_{m}(16,-1)\) or \( x^{2}=5U_{m}(16,-1)+2U_{m-1}(16,-1).\) Assume that

$$\begin{aligned} x^{2}=2U_{m+1}(16,-1)+5U_{m}(16,-1). \end{aligned}$$

Since x is odd, it is seen from (2.23) that m is odd. Besides,

$$\begin{aligned} x^{2}\equiv 2U_{m+1}(16,-1)\text { }(\text{ mod }\text { }5), \end{aligned}$$

which implies that \(5|U_{m+1}.\) It can be easily shown that \(5|U_{m}(16,-1)\) iff 3|m. Thus, we get \(m+1=3k\) for some \(k>0.\) Since m is odd, k is even and therefore \(k=2q.\) Hence, we have \(m=6q-1\) with \(q\ge 0.\) And so, by (2.5), we get

$$\begin{aligned} x^{2}&=2U_{2.3q}(16,-1)+5U_{2.3q-1}(16,-1)\\&\equiv 2U_{0}(16,-1)+5U_{-1}(16,-1) \text { }\left( \text{ mod }\text { }U_{3}(16,-1)\right) , \end{aligned}$$

implying that \(x^{2}\equiv -5 \left( \text{ mod }\text { }17\right) ,\) because \(17|U_{3}(16,-1).\) But this is impossible since \(\left( \frac{-5}{17} \right) =-1.\)

Similarly, we prove that the equation \(x^{2}=5U_{m}(16-1)+2U_{m-1}(16,-1)\) is impossible. This completes the proof. \(\square \)

Lemma 12

The equation \(9x^{4}-21y^{2}=-3\) has no positive integer solution.

Proof

Dividing both sides of the equation by 3 gives \(7y^{2}-3x^{4}=1.\) Now let us consider the equation

$$\begin{aligned} 7u^{2}-3v^{2}=1. \end{aligned}$$
(3.1)

Since the fundamental solution to (3.1) is \(2\sqrt{7}+3\sqrt{3},\) it can be shown that all positive integer solutions to (3.1) are given by \((u,v)=(2(U_{n+1}-U_{n}),3(U_{n+1}+U_{n})),\) where \(U_{n}=U_{n}(150,-1).\) Therefore, we have \(x^{2}=3(U_{n+1}+U_{n}).\) It can be easily seen that

$$\begin{aligned} U_{n}\equiv \left\{ \begin{array}{ll} n\text { }(\text{ mod }\text { }8)&{}\quad \text { if }n\text { is odd,} \\ -n\text { }(\text{ mod }\text { }8)&{}\quad \text { if }n\text { is even.} \end{array} \right. \end{aligned}$$
(3.2)

Hence, if n is odd, then \(x^{2}\equiv -3n-3+3n\equiv -3(\text{ mod } 8),\) a contradiction. If n is even, then \(x^{2}\equiv 3n+3-3n\equiv 3(\text{ mod } 8),\) a contradiction. This completes the proof. \(\square \)

We begin with the following theorem. This result will be used in the solution to the equation \(U_{n}=7\square .\)

Theorem 13

If P is an odd integer, then there is no integer x such that \(V_{n}=14x^{2}.\)

Proof

Assume \(V_{n}=14x^{2}\) and P is odd. Since \(2|V_{n}, 3|n\) by (2.12 ). The remainder of the proof is split into two cases.

Case I: Assume 7|P or \(P^{2}\equiv 4 (\text{ mod } 7).\) Since \( 7|V_{n}, \) it is seen from Lemma 6 that \(2\not \mid n.\) Since 3|n,  we get \(n=3t\) and therefore \(2\not \mid t.\) Thus we can write \(n=12q\pm 3.\) And so, by (2.2), we obtain \(V_{n}=V_{12q\pm 3}\equiv \pm V_{3} (\text{ mod } U_{6}),\) which implies that \(14x^{2}\equiv \pm 4P\equiv 4 (\text{ mod } 8).\) This shows that \(x^{2}\equiv 2 (\text{ mod } 4),\) a contradiction.

Case II: Assume \(P^{2}\equiv 1 (\text{ mod } 7)\) or \(P^{2}\equiv 2 ( \text{ mod } 7).\) Since \(7|V_{n},\) it follows that \(n=4t\) for some odd t by Lemma 6. Since 3|n,  we see that 3|t and therefore \(t=6q+3.\) Thus we can write \(n=24q+12.\) Let \(P^{2}\equiv 1 (\text{ mod } 7).\) And so, by (2.4), we get

$$\begin{aligned} V_{n}=V_{24q+12}=V_{2\cdot 2\cdot 6q+12}\equiv V_{12}\equiv -V_{0}\equiv -2 \text { }(\text{ mod } V_{2}), \end{aligned}$$

which implies that \(14x^{2}\equiv -2 (\text{ mod } P^{2}+2).\) Hence, we obtain \(1=\left( \frac{-7}{P^{2}+2}\right) \) . But this is impossible since

$$\begin{aligned} \left( \frac{-7}{P^{2}+2}\right) =(-1)^{\frac{P^{2}+1}{2}}(-1)^{\frac{P^{2}+1 }{2}}\left( \frac{P^{2}+2}{7}\right) =\left( \frac{3}{7}\right) =\left( \frac{-4}{7}\right) =-1. \end{aligned}$$

Now let \(P^{2}\equiv 2(\text{ mod } 7).\) Since \(n=24q+12,\) it follows from ( 2.2) that

$$\begin{aligned} V_{n}=V_{24q+12}=V_{2\cdot 3(4q+2)}\equiv V_{0}\equiv 2\text { }(\text{ mod } U_{3}), \end{aligned}$$

which implies that \(14x^{2}\equiv 2 (\text{ mod } P^{2}+1),\) i.e., \( 7x^{2}\equiv 1 (\text{ mod }(P^{2}+1)/2).\) But this is also impossible since

$$\begin{aligned} \left( \frac{7}{(P^{2}+1)/2}\right) =(-1)^{\frac{P^{2}-1}{4}}\left( \frac{ (P^{2}+1)/2}{7}\right) =\left( \frac{5}{7}\right) =\left( \frac{-2}{7} \right) =-1. \end{aligned}$$

This completes the proof. \(\square \)

Theorem 14

Let P be odd. If 7|P,  then \(V_{n}=7x^{2}\) is possible if and only if \((P,n)=(7\square ,1).\) If \(7\not \mid P,\) then \(V_{n}=7x^{2}\) is impossible, except for the case \((P,n)=(1,4).\)

Proof

Assume that \(V_{n}=7x^{2}, 7|P\) and P is odd. Then by Theorem 3.4 given in [11], we get \(n=1\) or \(n=3.\) If \(n=1,\) then \( V_{1}=P=7x^{2}\) is a solution. If \(n=3,\) then \(V_{3}=P(P^{2}+3)=7x^{2}.\) Since 7|P,  it follows that \(\left( P/7\right) \left( P^{2}+3\right) =x^{2}. \) Clearly, \(d=\left( P/7,P^{2}+3\right) =1\) or 3.

Let \(d=1.\) Then, \(P^{2}+3=b^{2}\) gives \(3=(b-P)(b+P)\) and the only positive integer solution is \((b,P)=(2,1),\) which is not convenient since we must have 7|P.

Let \(d=3.\) Then we have

$$\begin{aligned} P=21a^{2}\text { and }P^{2}+3=3b^{2}. \end{aligned}$$
(3.3)

It is seen from (3.3) that 3|P and therefore

$$\begin{aligned} P=3c \end{aligned}$$
(3.4)

for some \(c>0.~\)Substituting (3.4) into (3.3), we immediately have the Pell equation \(b^{2}-3c^{2}=1.\) It is well known that all positive integer solutions to the equation \(b^{2}-3c^{2}=1\) are given by \(\left( b,c\right) =\left( V_{m}\left( 4,-1\right) /2,U_{m}\left( 4,-1\right) \right) \) with \(m\ge 1.\) On the other hand, since \(3c=21a^{2},\) we get \( c=7a^{2}.\) So, we are looking for the solutions \(U_{m}\left( 4,-1\right) =7\square .\) Since \(7|U_{4}(4,-1),\) it can be easily shown that \( 7|U_{m}(4,-1)\) iff \(m=4k\) for some \(k\ge 1.\) Then by (2.9), it follows that

$$\begin{aligned} 7\square =U_{4k}\left( 4,-1\right) =U_{2k}\left( 4,-1\right) V_{2k}\left( 4,-1\right) . \end{aligned}$$

From (2.14) and (2.23), it is seen that \(\left( U_{2k}\left( 4,-1\right) ,V_{2k}\left( 4,-1\right) \right) =2.\) Then either

$$\begin{aligned} U_{2k}\left( 4,-1\right) =2u^{2}\text { and }V_{2k}\left( 4,-1\right) =14v^{2} \end{aligned}$$
(3.5)

or

$$\begin{aligned} U_{2k}\left( 4,-1\right) =14u^{2}\text { and }V_{2k}\left( 4,-1\right) =2v^{2}. \end{aligned}$$
(3.6)

From now on and until the end of this paragraph, instead of \(U_{n}(4,-1)\) and \(V_{n}(4,-1),\) we will write \(U_{n}\) and \(V_{n},\) respectively. Suppose ( 3.5) is satisfied. Clearly, \(7|V_{2k}.\) Since \(7|V_{2},\) it can be easily shown that k is odd. Let \(k=4q\pm 1.\) By (2.5), we get

$$\begin{aligned} 2u^{2}=U_{2(4q\pm 1)}\equiv U_{\pm 2}\text { }(\text{ mod }U_{4}). \end{aligned}$$

Since \(8|U_{4},\) the previous congruence becomes \(2u^{2}\equiv \pm 4 ( \text{ mod } 8),\) which is impossible. Suppose (3.6) is satisfied. We show that if \(V_{n}=2v^{2},\) then 3|n. Let \(n=6q+r, 0\le r\le 5.\) Then by (2.6), it follows that \(V_{n}\equiv V_{r} (\text{ mod } U_{3}),\) implying that \(2v^{2}\equiv V_{r} (\text{ mod } 5)\) since \(5|U_{3}.\) From this, it follows that \(r=0\) or 3. This shows that 3|n. Returning to the equation \(V_{2k}=2v^{2},\) we have \(k=3r.\) Thus \(V_{6r}=V_{3\cdot 2r}=V_{2r}(V_{2r}^{2}-3)=2v^{2}\) by (2.11). This implies that \(v^{2}= \frac{V_{2r}}{2}(V_{2r}^{2}-3).\) On the other hand, since \( V_{n}^{2}-12U_{n}^{2}=4\) by (2.22), we see that \(3\not \mid V_{n}.\) Thus, \(\left( \frac{V_{2r}}{2},V_{2r}^{2}-3\right) =1.\) Then, we have \( V_{2r}^{2}-3=a^{2},\) which is impossible.

Now we consider the case \(P^{2}\equiv 1 (\text{ mod } 7).\) Since \(7|V_{n},\) it follows from Lemma 6 that \(n=4t\) for some odd integer t. Let \( t>1.\) We can write \(t=4q\pm 1\) with \(q\ge 1\) and therefore \(n=4t=2\cdot 2^{r}a\pm 4,\) with a odd and \(r\ge 3.\) Thus by (2.4), we get \( V_{n}\equiv -V_{4} (\text{ mod } V_{2^{r}}).\) If \(r=3,\) then

$$\begin{aligned} 7x^{2}\equiv -V_{4}\text { }(\text{ mod }\text { }V_{8}) \end{aligned}$$
(3.7)

and if \(r>3,\) then

$$\begin{aligned} 7x^{2}\equiv -V_{4}\text { }(\text{ mod }\text { }V_{2^{r}}). \end{aligned}$$
(3.8)

Since \(V_{8}=V_{4}^{2}-2\) by (2.10), it follows that \(V_{8}\equiv -2 (\text{ mod } V_{4})\) and therefore \(V_{2^{r}}\equiv 2 (\text{ mod } V_{4}).\) Note that \(V_{4}=P^{4}+4P^{2}+2.\) Since \(P^{2}\equiv 1 (\text{ mod } 7),\) we see that \(7|V_{4}\) and therefore by (2.10), we have \( V_{8}\equiv -2 (\text{ mod } 7)\) and \(V_{2^{r}}\equiv 2 (\text{ mod } 7). \) Besides, since P is odd, it follows that \(V_{4}\equiv 7 (\text{ mod } 8)\) and \(V_{8}\equiv 7 (\text{ mod } 8).\) Also, \(\left( \frac{-1}{ V_{2^{r}}}\right) =-1\) by (2.21). Assume that \(r=3,\) so that, by (3.7 ), we have \(\left( \frac{7}{V_{8}}\right) =\left( \frac{-1}{V_{8}}\right) \left( \frac{V_{4}}{V_{8}}\right) .\) But this is impossible since

$$\begin{aligned} \left( \frac{7}{V_{8}}\right) =(-1)\left( \frac{V_{8}}{7}\right) =(-1)(\frac{ -2}{7})=1,\left( \frac{-1}{V_{8}}\right) =-1 \end{aligned}$$

and

$$\begin{aligned} \left( \frac{V_{4}}{V_{8}}\right) =(-1)\left( \frac{V_{8}}{V_{4}}\right) =(-1)\left( \frac{-2}{V_{4}}\right) =\left( \frac{2}{V_{4}}\right) =1, \end{aligned}$$

because \(V_{4}+2=(P^{2}+2)^{2}.\)

Now assume that \(r>3,\) so that, (3.8) is satisfied. Then, it follows that \(\left( \frac{7}{V_{2^{r}}}\right) =\left( \frac{-1}{V_{2^{r}}}\right) \left( \frac{V_{4}}{V_{2^{r}}}\right) .\) But this is also impossible since

$$\begin{aligned} \left( \frac{7}{V_{2^{r}}}\right) =(-1)\left( \frac{V_{2^{r}}}{7}\right) =(-1)\left( \frac{2}{7}\right) =-1,\left( \frac{-1}{V_{2^{r}}}\right) =-1 \end{aligned}$$

and

$$\begin{aligned} \left( \frac{V_{4}}{V_{2^{r}}}\right) =(-1)\left( \frac{V_{2^{r}}}{V_{4}} \right) =(-1)\left( \frac{2}{V_{4}}\right) =-1. \end{aligned}$$

Hence, we conclude that \(t=1.\) Then \(n=4\) and therefore \( V_{4}=(P^{2}+2)^{2}-2=V_{n}=7x^{2}.\) Now, we consider the equation \( u^{2}-7v^{2}=2\) with \(u=P^{2}+2.\) It can be easily shown that all positive integer solutions to the equation \(u^{2}-7v^{2}=2\) are given by

$$\begin{aligned} (u,v)=\left( 3(U_{m+1}(16,-1)-U_{m}(16,-1)),\text { } 17U_{m}(16,-1)-U_{m-1}(16,-1)\right) \end{aligned}$$

with \(m\ge 0.\) And so, we get \(P^{2}+2=3(U_{m+1}(16,-1)-U_{m}(16,-1)).\) From now on and until the end of the case \(P^{2}\equiv 1 (\text{ mod } 7),\) instead of \(U_{m}(16,-1),\) we will write \(U_{m}.\) Let \(m=4q+r, 0\le r\le 3.\) Then by (2.5), it follows that \(U_{4q+r}\equiv U_{r} (\text{ mod } U_{2}),\) implying that \(P^{2}+2\equiv 3(U_{r+1}-U_{r}) (\text{ mod } 16) \) since \(16|U_{2}.\) A simple calculation shows that \(r=0\) and therefore 4|m. So, we can write \(m=12q, 12q+4\) or \(12q+8.\) If \(m=12q+4,\) then we obtain \(P^{2}+2\equiv 3(U_{12q+5}-U_{12q+4})\equiv 3(U_{5}-U_{4}) (\text{ mod } U_{3})\) by (2.5). Since \(5|U_{3},\) we immediately have \( P^{2}+2\equiv 0 (\text{ mod } 5),\) which is impossible. Now the remainder of the proof is split into two cases.

Case I: Let \(m=12q\) with \(q\ge 0.\) If \(q>0,\) then we can write \(m=12q=2\cdot 2^{r}\cdot 3a,\) with a odd and \(r\ge 1.\) Thus by (2.7 ), we get

$$\begin{aligned} P^{2}+2=3(U_{2\cdot 2^{r}\cdot 3a+1}-U_{2\cdot 2^{r}\cdot 3a}) \equiv -3\text { }(\text{ mod } \text { }V_{2^{r}}), \end{aligned}$$

leading to

$$\begin{aligned} P^{2}\equiv -5\text { }(\text{ mod } \text { }V_{2^{r}}/2). \end{aligned}$$
(3.9)

If \(r\ge 2,\) then a simple calculation shows that \(V_{2^{r}}\equiv 2 ( \text{ mod } 8)\) and \(V_{2^{r}}\equiv -1 (\text{ mod } 5).\) Thus, \( V_{2^{r}}/2\equiv 1 (\text{ mod } 4)\) and \(V_{2^{r}}/2\equiv 2 (\text{ mod } 5).\) From (3.9), it is seen that \(1=\left( \frac{-1}{V_{2^{r}}/2} \right) \left( \frac{5}{V_{2^{r}}/2}\right) .\) But this is impossible since

$$\begin{aligned} \left( \frac{-1}{V_{2^{r}}/2}\right) =1 \end{aligned}$$

and

$$\begin{aligned} \left( \frac{5}{V_{2^{r}}/2}\right) =\left( \frac{V_{2^{r}}/2}{5}\right) =\left( \frac{2}{5}\right) =-1. \end{aligned}$$

Hence, we get \(r=1.\) By (2.7), it follows that \(P^{2}+2=3(U_{2\cdot 6a+1}-U_{2\cdot 6a}) \equiv -3 (\text{ mod } V_{6}),\) i.e., \( P^{2}\equiv -5 (\text{ mod } V_{6}/2).\) This implies that \(1=\left( \frac{ -1}{V_{6}/2}\right) \left( \frac{5}{V_{6}/2}\right) .\) Using the fact that \( V_{6}/2\equiv 1 (\text{ mod } 5)\) and \(V_{6}/2\equiv 3 (\text{ mod } 4),\) we readily obtain

$$\begin{aligned} 1=\left( \frac{-1}{V_{6}/2}\right) \left( \frac{5}{V_{6}/2}\right) =(-1)\left( \frac{V_{6}/2}{5}\right) =(-1)\left( \frac{1}{5}\right) =-1, \end{aligned}$$

a contradiction. Thus, we get \(q=0.\) Then \(m=0\) and therefore \(P^{2}+2=3.\) This gives that \(P=1.\)

Case II: Let \(m=12q+8\) with \(q\ge 0.\) This implies that \(m=12u-4.\) Then by (2.7), we get

$$\begin{aligned} P^{2}+2=3(U_{2\cdot 3\cdot 2q-3}-U_{2\cdot 3\cdot 2q-4})\equiv 3(U_{-3}-U_{-4})\equiv 3(U_{4}-U_{3})(\text{ mod } \text { }V_{3}). \end{aligned}$$

A simple calculation shows that \(11|V_{3}, U_{4}\equiv 5 (\text{ mod } 11),\) and \(U_{3}\equiv 2 (\text{ mod } 11).\) Thus, it is seen that \( P^{2}\equiv 7 (\text{ mod } 11),\) which is impossible since \(\left( \frac{7 }{11}\right) =\left( \frac{-4}{11}\right) =-1.\)

Assume that \(P^{2}\equiv 2 (\text{ mod } 7).\) Since \(7|V_{n},\) it follows from Lemma 6 that \(n=4t\) for some odd integer t. Similar arguments used for the case when \(P^{2}\equiv 1 (\text{ mod } 7)\) show that \(P=1.\) But this is impossible since \(P^{2}\equiv 2 (\text{ mod } 7).\)

Assume that \(P^{2}\equiv 4 (\text{ mod } 7).\) Since \(7|V_{n},\) it follows that \(n=3t\) for some odd integer t by Lemma 6. Hence, \( V_{n}=V_{3t}=V_{t}(V_{t}^{2}+3)\) from (2.11). Clearly, \(\left( V_{t},V_{t}^{2}+3\right) =1\) or 3.

Let \(\left( V_{t},V_{t}^{2}+3\right) =1.\) Then either

$$\begin{aligned} V_{t}=a^{2},\text { }V_{t}^{2}+3=7b^{2} \end{aligned}$$
(3.10)

or

$$\begin{aligned} V_{t}=7a^{2},\text { }V_{t}^{2}+3=b^{2} \end{aligned}$$
(3.11)

for some positive integers a and b. But the two relations (3.11) lead to \(b^{2}\equiv 3 (\text{ mod } 7)\) which is impossible, hence (3.10) is satisfied. Solving the systems of equations \(V_{t}=a^{2}, V_{t}^{2}+3=7b^{2}\) gives \(a^{4}-7b^{2}=-3,\) which has no positive integer solution by Theorem 11.

Let \(\left( V_{t},V_{t}^{2}+3\right) =3.\) This implies that either

$$\begin{aligned} V_{t}=3a^{2},\text { }V_{t}^{2}+3=21b^{2} \end{aligned}$$
(3.12)

or

$$\begin{aligned} V_{t}=21a^{2},\text { }V_{t}^{2}+3=3b^{2} \end{aligned}$$
(3.13)

for some \(a,b>0.\) Assume that (3.12) is satisfied. Then we get \( 9a^{4}-21b^{2}=-3,\) which has no positive integer solution by Lemma 12. Now assume that (3.13) is satisfied. Since \(3|V_{t}\) and t is odd, it follows from Lemma 5 that 3|P. On the other hand, it is seen that \(V_{t}^{2}=V_{2t}-2\) by (2.10). Combining the equation \( V_{t}^{2}=V_{2t}-2\) with \(V_{t}^{2}+3=3b^{2}\) gives \(V_{2t}=3b^{2}-1.\) Let \( t>1.\) Then we can write \(t=4q\pm 1=2^{r}z\pm 1\) with z odd and \(r\ge 2.\) And so by (2.4), we get

$$\begin{aligned} V_{2t}=V_{2\cdot 2^{r}z\pm 2}\equiv -V_{2}\text { }\left( \text{ mod } \text { } V_{2^{r}}\right) , \end{aligned}$$

implying that

$$\begin{aligned} 3b^{2}\equiv -\left( P^{2}+2-1\right) \equiv -U_{3}\text { }\left( \text{ mod } \text { }V_{2^{r}}\right) . \end{aligned}$$

This means that

$$\begin{aligned} \left( \frac{-3U_{3}}{V_{2^{r}}}\right) =1. \end{aligned}$$

We have \(\left( \frac{-1}{V_{2^{r}}}\right) =-1\) and \(\left( \frac{U_{3}}{ V_{2^{r}}}\right) =1\) by (2.21) and (2.15), respectively. On the other hand, \(V_{2^{r}}\equiv 2 \left( \text{ mod } \text { }3\right) \) by (2.13), leading to

$$\begin{aligned} \left( \frac{3}{V_{2^{r}}}\right) =\left( -1\right) ^{\frac{V_{2^{r}}-1}{2} }\left( \frac{V_{2^{r}}}{3}\right) =\left( -1\right) \left( \frac{2}{3} \right) =1. \end{aligned}$$

Therefore,

$$\begin{aligned} \left( \frac{-3U_{3}}{V_{2^{r}}}\right) =\left( \frac{-1}{V_{2^{r}}}\right) \left( \frac{3}{V_{2^{r}}}\right) \left( \frac{U_{3}}{V_{2^{r}}}\right) =\left( -1\right) \left( 1\right) \left( 1\right) =-1, \end{aligned}$$

which contradicts the displayed relation a few lines above. Hence, \(t=1\) and therefore \(V_{1}=P=21\square .\) But this contradicts the fact that \( P^{2}\equiv 4 \left( \text{ mod } \text { }7\right) .\) This completes the proof. \(\square \)

Theorem 15

If P is odd, then, a relation of the form \(V_{n}=7V_{m}x^{2}\) with \(V_{m}\ne 1,\) is possible if and only if \(P^{2}=-3+7\square ,\) (hence P is given by Lemma 8) and \((n,m)=(3,1).\) If P is even and \( P^{2}\equiv 2(\text{ mod } 7),\) then a relation of the form \( V_{n}=7V_{m}x^{2}\) with \(V_{m}\ne 1,\) is impossible.

Proof

The strategy of the proof is as follows. Let \(V_{n}=7V_{m}x^{2},\) where \( V_{m}\ne 1.\) Under the assumption that, either \(P\equiv 0,\pm 1(\text{ mod } 7)\) and P is odd, or \(P^{2}\equiv 2(\text{ mod } 7)\) (independently of the parity of P), we will arrive at a contradiction. Finally, if \( P^{2}\equiv 4(\text{ mod } 7)\) and P is odd, we will prove that \( (n,m)=(3,1).\) In the last case, \(V_{3}=7V_{1}x^{2},\) which is equivalent to \( P^{2}-7x^{2}=-3;\) hence P is obtained by applying Lemma 8.

Case I: Assume that 7|P and \(V_{n}=7V_{m}x^{2}.\) Since \(7|V_{n},\) it follows from Lemma 6 that \(n\ge 3\) is odd. Furthermore, since \( V_{m}|V_{n},\) there exists an odd integer t such that \(n=mt\) by (2.16 ). Thus, m is odd. Therefore, we have \(V_{n}\equiv nP \left( \text{ mod } \text { }P^{2}\right) \) and \(V_{m}\equiv mP \left( \text{ mod } \text { } P^{2}\right) \) by Lemma 9. This shows that \(nP\equiv 7mPx^{2} \left( \text{ mod } \text { }P^{2}\right) ,\) i.e., \(n\equiv 7mx^{2} \left( \text{ mod } \text { }P\right) .\) Since 7|P,  it is obvious that 7|n. Since 7|n and \(n=mt,\) it is seen that 7|mt.

Assume that 7|t. Then \(t=7s\) for some odd positive integer s and therefore \(n=mt=7ms.\) By (2.18), we immediately have

$$\begin{aligned} 7V_{m}x^{2}= & {} V_{n}=V_{7ms}=V_{ms}\left( V_{2ms}^{3}+V_{2ms}^{2}-2V_{2ms}-1\right) \\= & {} V_{ms}(V_{ms}^{6}+7V_{ms}^{4}+14V_{ms}^{2}+7), \end{aligned}$$

by (2.18). This implies that 7 divides the parenthesis, i.e.,

$$\begin{aligned} 7|\left( V_{2ms}^{3}+V_{2ms}^{2}-2V_{2ms}-1\right) . \end{aligned}$$

Hence, we get \(x^{2}=\frac{V_{ms}}{V_{m}}\left( \frac{ V_{2ms}^{3}+V_{2ms}^{2}-2V_{2ms}-1}{7}\right) .\) We have,

$$\begin{aligned} \left( \frac{V_{ms}}{V_{m}},\frac{V_{2ms}^{3}\!+\!V_{2ms}^{2}-2V_{2ms}-1}{7} \right) \!=\!\left( \frac{V_{ms}}{V_{m}} ,(V_{ms}^{6}\!+\!7V_{ms}^{4}\!+\!14V_{ms}^{2}+7)/7)\right) =1. \end{aligned}$$

Then

$$\begin{aligned} V_{ms}=V_{m}a^{2}\text { and }V_{2ms}^{3}+V_{2ms}^{2}-2V_{2ms}-1=7b^{2} \end{aligned}$$

for some \(a,b>0.\) By Theorem 10, we have \(ms=3, m=1,\) and \(P=1\) or \( ms=m.\) If \(m=1\) and \(P=1,\) then, we see that \(V_{m}=V_{1}=P=1,\) which is impossible since \(V_{m}\ne 1.\) If \(ms=m,\) then, \(s=1.\) Since \(n=7ms,\) we get \(n=7m.\) By Theorem 2, it follows that

$$\begin{aligned} V_{n}=V_{7m}=V_{8m-m}=V_{2\cdot 4m-m}\equiv -V_{-m}\text { }(\text{ mod } V_{4}), \end{aligned}$$

implying that

$$\begin{aligned} 7V_{m}x^{2}\equiv V_{m}\text { }(\text{ mod } V_{4}). \end{aligned}$$

Since \(V_{4}\) is odd, it follows by (2.14) that \((U_{2m},V_{4})=1.\) But \(U_{2m}=U_{m}V_{m},\) by (2.9), hence \((V_{m},V_{4})=1.\) Therefore, the congruence becomes \(7x^{2}\equiv 1 (\text{ mod } V_{4}).\) Using the fact that 7|P,  we have

$$\begin{aligned} 1=\left( \frac{7}{V_{4}}\right) =(-1)^{\frac{V_{4}-1}{2}}\left( \frac{V_{4}}{ 7}\right) =(-1)\left( \frac{2}{7}\right) =-1, \end{aligned}$$

a contradiction.

Now assume that \(7\not \mid t,\) so that 7|m. So, we can write \(m=7^{r}a\) with \( 7\not \mid a\) and \(r\ge 1.\) By (2.20), we get \( V_{m}=V_{7^{r}a}=7V_{7^{r-1}a}\left( 7a_{1}+1\right) \) for some positive integer \(a_{1}.\) Thus, we conclude that

$$\begin{aligned} V_{m}=V_{7^{r}a}=7^{r}V_{a}\left( 7a_{1}+1\right) \left( 7a_{2}+1\right) \cdot \cdot \cdot \left( 7a_{r}+1\right) \end{aligned}$$

for some \(a_{i}>0\) with \(1\le i\le r.\) Let \(A=\left( 7a_{1}+1\right) \left( 7a_{2}+1\right) \cdot \cdot \cdot \left( 7a_{r}+1\right) .\) As a consequence, \(V_{m}=7^{r}V_{a}A.\) It is clear that \(7\not \mid A.\) In a similar way, we see that

$$\begin{aligned} V_{n}=V_{7^{r}at}=7^{r}V_{at}\left( 7b_{1}+1\right) \left( 7b_{2}+1\right) \cdot \cdot \cdot \left( 7b_{r}+1\right) \end{aligned}$$

for some \(b_{j}>0\) with \(1\le j\le r.\) Thus, we have \(V_{n}=7^{r}V_{at}B,\) where \(B=\left( 7b_{1}+1\right) \left( 7b_{2}+1\right) \cdot \cdot \cdot \left( 7b_{r}+1\right) .\) Clearly, \(7\not \mid B.\) Upon substituting the values of \(V_{n}\) and \(V_{m}\) into \(V_{n}=7V_{m}x^{2},\) we obtain

$$\begin{aligned} 7^{r}V_{at}B=7\cdot 7^{r}V_{a}Ax^{2}, \end{aligned}$$

implying that \(V_{at}B=7V_{a}Ax^{2}.\) By Lemma 9, it is seen that \( atPB\equiv 7aPAx^{2} \left( \text{ mod }\text { }P^{2}\right) ,\) which gives that \(atB\equiv 7aAx^{2} \left( \text{ mod } \text { }P\right) .\) Since 7|P,  it follows that 7|atB. But this is impossible since \(7\not \mid a, 7\not \mid t,\) and \(7\not \mid B.\)

Case II:  Assume that \(P^{2}\equiv 1 (\text{ mod } 7).\) From Lemma 6, it is seen that \(n=4t\) for some odd positive integer t. Therefore, we can write \(n=12q\) for some odd q or \(n=12q\pm 4\) for some even q. Firstly, let \(n=12q\). And so by (2.2), we get

$$\begin{aligned} V_{n}=V_{12q}=V_{2\cdot 6q}\equiv V_{0}\text { }\left( \text{ mod } \text { } U_{6}\right) . \end{aligned}$$

Since \(U_{6}=P^{5}+4P^{3}+3P\) and P is odd, it is easily seen that \( 8|U_{6}.\) Hence, we have \(V_{n}\equiv 2\left( \text{ mod } \text { }8\right) .\) Secondly, let \(n=12q\pm 4.\) Then we immediately have from (2.2) that

$$\begin{aligned} V_{n}=V_{12q\pm 4}=V_{2\cdot 6q\pm 4}\equiv V_{\pm 4}\text { }\left( \text{ mod } \text { }U_{6}\right) , \end{aligned}$$

implying that \(V_{n}\equiv V_{4} \left( \text{ mod } \text { }8\right) .\) Using the fact that \(V_{4}=P^{4}+4P^{2}+2\) and P is odd, we obtain \( V_{4}\equiv 7 \left( \text{ mod } \text { }8\right) \) in this case. Hence, we conclude that \(V_{n}\equiv 2,7 \left( \text{ mod } \text { }8\right) .\) On the other hand, since \(V_{m}|V_{n},\) we get \(n=ms\) for some odd s by (2.16). It is known that 4|n and s is odd. Hence, we see that 4|m and therefore \(m=4u\) for some odd u. And so, with arguments similar to those a few lines above, we have \(V_{m}\equiv 2,7 \left( \text{ mod } \text { } 8\right) .\) Thus, \(7V_{m}\equiv 14,49\equiv 6,1 \left( \text{ mod } \text { } 8\right) .\) As a consequence,

$$\begin{aligned} V_{n}=7V_{m}x^{2}\equiv 1,6\left\{ \begin{array}{c} 0 \\ 1 \\ 4 \end{array} \right\} \equiv 0,1,4,6\text { }\left( \text{ mod } \text { }8\right) . \end{aligned}$$

But this contradicts the fact that \(V_{n}\equiv 2,7 \left( \text{ mod } \text { }8\right) .\)

Case III: Assume that \(P^{2}\equiv 2 \left( \text{ mod } \text { }7\right) .\) Since \(7|V_{n},\) it follows from Lemma 6 that \(n=4t\) for some odd t. Furthermore, since \(V_{m}|V_{n},\) there exists an odd integer \(s(>1)\) such that \(n=ms\) by (2.16). Thus, we can write \(s=4q\pm 1\) for some \( q\ge 1.\) Since 4|n and s is odd, it is seen that m is even and also 4|m. Upon substituting \(n=ms\) and \(s=4q\pm 1\) into \(V_{n},\) we get

$$\begin{aligned} V_{n}=V_{ms}=V_{m(4q\pm 1)}=V_{2\cdot 2mq\pm m}\equiv V_{m}\text { }\left( \text{ mod } \text { }U_{2m}\right) \end{aligned}$$

by (2.2). This implies that \(7V_{m}x^{2}\equiv V_{m} \left( \text{ mod } \text { }U_{m}V_{m}\right) \) by (2.9). Dividing both sides of the congruence by \(V_{m}\) gives \(7x^{2}\equiv 1\left( \text{ mod } \text {~} U_{m}\right) .\) Since 4|m,  it is clear from (2.17) that \( U_{4}|U_{m}. \) Since \(U_{4}=U_{2}V_{2}\) by (2.9), the preceding congruence becomes \(7x^{2}\equiv 1 \left( \text{ mod } \text { }V_{2}\right) ,\) i.e.,

$$\begin{aligned} 7x^{2}\equiv 1\text { }\left( \text{ mod } \text { }P^{2}+2\right) . \end{aligned}$$
(3.14)

Assume that P is odd. Using \(P^{2}\equiv 2 \left( \text{ mod } \text { } 7\right) ,\) we get from (3.14) that

$$\begin{aligned} 1=\left( \frac{7}{P^{2}+2}\right) =\left( -1\right) ^{\frac{P^{2}+1}{2} }\left( \frac{P^{2}+2}{7}\right) =\left( -1\right) \left( \frac{4}{7}\right) =-1, \end{aligned}$$

a contradiction. Now assume that P is even. If 2|P and \(4\not \mid P,\) then from (3.14), we obtain \(7x^{2}\equiv 1 \left( \text{ mod } \text { }\frac{P^{2}+2}{2}\right) ,\) implying that \(1=\left( \frac{7}{\left( P^{2}+2\right) /2}\right) .\) Since \(P^{2}\equiv 2 \left( \text{ mod } \text { } 7\right) ,\) it can be seen that \(\left( P^{2}+2\right) /2\equiv 2 \left( \text{ mod } \text { }7\right) .\) Hence, we get

$$\begin{aligned} 1=\left( \frac{7}{\left( P^{2}+2\right) /2}\right) =\left( -1\right) ^{\frac{ P^{2}}{4}}\left( \frac{\left( P^{2}+2\right) /2}{7}\right) \left( -1\right) \left( \frac{2}{7}\right) =-1, \end{aligned}$$

a contradiction. For the case when 4|P,  we turn back again to the congruence \(7x^{2}\equiv 1 \left( \text{ mod } \text { }U_{4}\right) .\) Since \( P|U_{4}\) we have \(7x^{2}\equiv 1 \left( \text{ mod } \text { }P\right) ,\) which implies that \(7x^{2}\equiv 1 \left( \text{ od } \text { }4\right) ,\) a contradiction.

Case IV: Assume that \(P^{2}\equiv 4 \left( \text{ mod } \text { }7\right) .\) Since \(7|V_{n},\) it follows from Lemma 6 that \(n=3t\) for some odd positive integer t. Moreover, since \(V_{m}|V_{n},\) it is obvious that \( n=ms \) for some odd \(s(>1)\) by (2.16). And so, we can write \(s=4q\pm 1\) with \(q\ge 1.\) Thus, we get \(n=ms=4qm\pm m.\) From now on, we divide the proof into two subcases.

Subcase i Let 3|m. Then by (2.17), \(U_{3}|U_{m}.\) Substituting \( n=4qm\pm m\) into \(V_{n}\) and using (2.2) and (2.9), we obtain \( V_{n}=V_{4qm\pm m}=V_{2\cdot 2mq\pm m}\equiv V_{\pm m}\left( \text{ mod } \text { }U_{m}V_{m}\right) ,\) i.e., \(7x^{2}\equiv \pm 1 \left( \text{ mod } \text { } U_{m}\right) .\) Since \(U_{3}|U_{m}\) and \(U_{3}=P^{2}+1,\) we conclude that

$$\begin{aligned} 7x^{2}\equiv \pm 1\text { }\left( \text{ mod } \text { }P^{2}+1\right) . \end{aligned}$$
(3.15)

It is clear from (3.15) that \(7x^{2}\equiv \pm 1 \left( \text{ mod } \text { }\frac{P^{2}+1}{2}\right) .\) Let \(7x^{2}\equiv 1 \left( \text{ mod } \text { } \frac{P^{2}+1}{2}\right) .\) This shows that \(1=\left( \frac{7}{\left( P^{2}+1\right) /2}\right) .\) Since \(P^{2}\equiv 4 \left( \text{ mod } \text { } 7\right) ,\) it follows that \(\frac{P^{2}+1}{2}\equiv -1 \left( \text{ mod } \text { }7\right) .\) Hence, we get

$$\begin{aligned} 1=\left( \frac{7}{\left( P^{2}+1\right) /2}\right) =\left( -1\right) ^{\frac{ P^{2}-1}{4}}\left( \frac{\left( P^{2}+1\right) /2}{7}\right) =\left( \frac{-1 }{7}\right) =-1, \end{aligned}$$

a contradiction. Similarly \(7x^{2}\equiv -1 \left( \text{ mod } \text { }\frac{ P^{2}+1}{2}\right) \) leads to a contradiction.

Subcase ii Let \(3\not \mid m.\) Since 3|n and \(n=ms,\) it follows that 3|s and therefore \(s=3k\) for some odd k. Thus, we get \(n=ms=3mk.\) Substituting this into \(V_{n}\) gives \(V_{n}=V_{3mk}=V_{mk}\left( V_{mk}^{2}+3\right) \) by (2.11). This implies that \(7V_{m}x^{2}=V_{mk}\left( V_{mk}^{2}+3\right) ,\) i.e., \(7x^{2}=\frac{V_{mk}}{V_{m}}\left( V_{mk}^{2}+3\right) .\) Clearly, \(d=\left( \frac{V_{mk}}{V_{m}} ,V_{mk}^{2}+3\right) =1\) or 3.

Let \(d=1.\) Then either

$$\begin{aligned} V_{mk}=V_{m}a^{2},\text { }V_{mk}^{2}+3=7b^{2} \end{aligned}$$
(3.16)

or

$$\begin{aligned} V_{mk}=7V_{m}a^{2},\text { }V_{mk}^{2}+3=b^{2} \end{aligned}$$
(3.17)

for some \(a,b>0.\) We immediately see that (3.17) does not hold. Because the only possible value of \(V_{mk}\) for which \(V_{mk}^{2}+3=b^{2}\) is \(V_{mk}=1,\) which is impossible. Assume that (3.16) holds. Then by Theorem 10, we obtain \(mk=3, m=1,\) and \(P=1\) or \(mk=m.\) If \(mk=3\) and \(P=1,\) then, \(V_{mk}^{2}+3=V_{3}^{2}+3=(P^{3}+3P)^{2}+3 =19=7b^{2},\) which is impossible. If \(mk=m,\) then, \(k=1.\) So, it is sufficient to consider the equation \(V_{m}^{2}+3=7b^{2}.\) From (2.10), it follows that \(V_{2m}+1=7b^{2}.\) Assume that \(m>1.\) Since m is odd, we can write \( 2m=2\left( 4q\pm 1\right) =2\left( 2^{r}z\right) \pm 2\) with z odd and \( r\ge 2.\) Then by (2.4),

$$\begin{aligned} V_{2m}=V_{2\cdot 2^{r}z\pm 2}\equiv -V_{2}\equiv -\left( P^{2}+2\right) \text { }\left( \text{ mod } \text { }V_{2^{r}}\right) , \end{aligned}$$

implying that

$$\begin{aligned} 7b^{2}\equiv -\left( P^{2}+2-1\right) \equiv -U_{3}\text { }\left( \text{ mod } \text { }V_{2^{r}}\right) . \end{aligned}$$

This means that \(1=\left( \frac{-7U_{3}}{V_{2^{r}}}\right) .\) We have \( \left( \frac{-1}{V_{2^{r}}}\right) =-1\) and \(\left( \frac{U_{3}}{V_{2^{r}}} \right) =1\) by (2.21) and (2.15), respectively. On the other hand, it is easy to see that \(V_{2^{r}}\equiv 6 \left( \text{ mod } \text { }7\right) \) when \(P^{2}\equiv 4 \left( \text{ mod } \text { }7\right) .\) Thus, we get

$$\begin{aligned} \left( \frac{7}{V_{2^{r}}}\right) =\left( -1\right) ^{\frac{V_{2^{r}}-1}{2} }\left( \frac{V_{2^{r}}}{7}\right) =\left( -1\right) \left( \frac{6}{7} \right) =-1\left( \frac{-1}{7}\right) =1. \end{aligned}$$

This concludes that \(1=\left( \frac{-7U_{3}}{V_{2^{r}}}\right) =\left( \frac{ -1}{V_{2^{r}}}\right) \left( \frac{7}{V_{2^{r}}}\right) \left( \frac{U_{3}}{ V_{2^{r}}}\right) =(-1)(1)(1)=-1,\) a contradiction. Hence, \(m=1\) and therefore \(n=3m=3.\) It is clear that \(m=1\) and \(n=3\) is a solution by Lemma 8.

Let \(d=3.\) Then, we obtain

$$\begin{aligned} V_{mk}=3V_{m}a^{2},\text { }V_{mk}^{2}+3=21b^{2} \end{aligned}$$
(3.18)

or

$$\begin{aligned} V_{mk}=21V_{m}a^{2},\text { }V_{mk}^{2}+3=3b^{2} \end{aligned}$$
(3.19)

for some \(a,b>0.\) Assume that (3.18) is satisfied. Then, by Theorem 3.7 given in [11], the only possible values of mk and m for which \(V_{mk}=3V_{m}a^{2}\) are \(mk=3\) and \(m=1.\) This implies that \( V_{3}^{2}+3=21b^{2}.\) Thus, we get \(V_{3}^{2}\equiv 4 \left( \text{ mod } \text { }7\right) .\) This is impossible since \(7|V_{3}.\) Now assume that (3.19) is satisfied. Since \(3|V_{mk}\) and mk is odd, it is seen that 3|P by Lemma 5. On the other hand, \(V_{mk}^{2}=V_{2mk}-2\) by (2.10). Combining the equations \(V_{mk}^{2}=V_{2mk}-2\) and \( V_{mk}^{2}+3=3b^{2},\) we get \(V_{2mk}=3b^{2}-1.\) Let \(mk=4q\pm 1=2^{r}z\pm 1\) with odd z and \(r\ge 2.\) And so by (2.4), we obtain

$$\begin{aligned} V_{2mk}=V_{2\cdot 2^{r}z\pm 2}\equiv -V_{2}\text { }( \text{ mod } V_{2^{r}}), \end{aligned}$$

implying that

$$\begin{aligned} 3b^{2}\equiv -\left( P^{2}+2-1\right) \equiv -U_{3}\text { }\left( \text{ mod } \text { }V_{2^{r}}\right) . \end{aligned}$$

This shows that \(1=\left( \frac{-3U_{3}}{V_{2^{r}}}\right) .\) We have \( \left( \frac{-1}{V_{2^{r}}}\right) =-1\) by (2.21), \(\left( \frac{U_{3}}{ V_{2^{r}}}\right) =1\) by (2.15), and \(V_{2^{r}}\equiv 2 \left( \text{ mod }\text { }3\right) \) by (2.13). Thus,

$$\begin{aligned} \left( \frac{3}{V_{2^{r}}}\right) =\left( -1\right) ^{\frac{V_{2^{r}}-1}{2} }\left( \frac{V_{2^{r}}}{3}\right) =\left( -1\right) \left( \frac{2}{3} \right) =1. \end{aligned}$$

Combining the above, we see that

$$\begin{aligned} 1=\left( \frac{-3U_{3}}{V_{2^{r}}}\right) =\left( \frac{-1}{V_{2^{r}}} \right) \left( \frac{3}{V_{2^{r}}}\right) \left( \frac{U_{3}}{V_{2^{r}}} \right) =\left( -1\right) \left( 1\right) \left( 1\right) =-1, \end{aligned}$$

a contradiction. This completes the proof. \(\square \)

Theorem 16

If P is odd, then \(U_{n}=7x^{2}\) is possible if and only if \( P=7\square \) and \(n=2.\)

Proof

Assume that \(U_{n}=7x^{2}\) for some \(x>0.\) Since \(7|U_{n}, n=2t\) for some positive integer t by Lemma 7. And so by (2.9), we get \( U_{n}=U_{2t}=U_{t}V_{t}=7x^{2}.\) Clearly, \(\left( U_{t},V_{t}\right) =1\) or 2 by (2.14).

Let \(\left( U_{t},V_{t}\right) =1.\) Then either

$$\begin{aligned} U_{t}=a^{2},\text { }V_{t}=7b^{2} \end{aligned}$$
(3.20)

or

$$\begin{aligned} U_{t}=7a^{2},\text { }V_{t}=b^{2} \end{aligned}$$
(3.21)

for some \(a,b>0.\) Assume that (3.20) is satisfied. Then by Theorem 14, the possible values of t for which \(V_{t}=7x^{2}\) are \(t=1\) when 7|P and \(t=4,P=1\) when \(P^{2}\equiv 1 ( \text{ mod } 7).\) If \(t=1,\) then \( n=2\) and therefore \(P=7\square \) is a solution. If \(t=4\) and \(P=1,\) then \( U_{4}=P^{3}+2P=3=a^{2},\) which is impossible in integers. Now assume that ( 3.21) is satisfied. Since \(7|U_{t},\) it is seen from Lemma 7 that t is even. Let \(t=2m.\) Then by (2.10), we see that \( b^{2}=V_{t}=V_{2m}=V_{m}^{2}\pm 2,\) which is impossible.

Let \(\left( U_{t},V_{t}\right) =2.\) Then either

$$\begin{aligned} U_{t}=2a^{2},\text { }V_{t}=14b^{2} \end{aligned}$$
(3.22)

or

$$\begin{aligned} U_{t}=14a^{2},\text { }V_{t}=2b^{2} \end{aligned}$$
(3.23)

for some \(a,b>0.\) According to Theorem 13, (3.22) cannot hold. Assume that (3.23) is satisfied. Then by Theorem 2 given in [2] and [4], we have \(t=6\) and \(P=1,5.\) But this is also impossible. For, otherwise we would have \(14a^{2}=U_{6}=U_{3}V_{3}=\left( P^{2}+1\right) \left( P^{3}+3P\right) \) which is impossible for \(P=1,5.\) This completes the proof. \(\square \)

Theorem 17

Let P be odd, \(m>1\) and \(U_{m}\ne 1.\) The equation \( U_{n}=7U_{m}x^{2}\) has solution only when \(P^{2}\equiv 1 ( \text{ mod } 7),\) in which case, the only solution is given by \((n,m,P,x)=(8,4,1,1).\)

Proof

Assume that \(U_{n}=7U_{m}x^{2}\) with \(m>1.\) Since \(U_{m}|U_{n},\) it follows from (2.17) that m|n. Thus, \(n=mt\) for some positive integer t. It is easy to see that \(n\ne m.\) Then, we have \(t>1.\) On the other hand, since \(7|U_{n},\) it is seen that n is even by Lemma 7. Since n is even and \(n=mt,\) either m or t is even.

Case I: t is even. Then \(t=2s\) for some \(s>0.\) By (2.9), we have \( U_{n}=U_{2ms}=U_{ms}V_{ms}=7U_{m}x^{2}.\) This yields that \(\left( U_{ms}/U_{m}\right) V_{ms}=7x^{2}.\) Clearly, \(\left( U_{ms}/U_{m},V_{ms}\right) =1\) or 2 by (2.14). If \(\left( U_{ms}/U_{m},V_{ms}\right) =1,\) then either

$$\begin{aligned} U_{ms}=U_{m}a^{2},\text { }V_{ms}=7b^{2} \end{aligned}$$
(3.24)

or

$$\begin{aligned} U_{ms}=7U_{m}a^{2},\text { }V_{ms}=b^{2} \end{aligned}$$
(3.25)

for some positive integers a and b. By Theorem 14, (3.24) is impossible when \(P^{2}\equiv 2 ( \text{ mod } 7)\) or \(P^{2}\equiv 4 ( \text{ mod } 7).\) If 7|P,  then by Theorem 14, we have \(ms=1.\) But this contradicts the fact that \(m>1.\) If \(P^{2}\equiv 1 ( \text{ mod } 7),\) then by Theorem 14, it follows that \(ms=4\) and \(P=1.\) Since \(m>1,\) we get \(m=4, s=1\) or \(m=2, s=2.\) Let \(m=4, s=1.\) Since \(t=2s\) and \( n=mt,\) we get \(n=8.\) Hence, \(U_{8}=7U_{4}x^{2},\) implying by (2.9) that \(V_{4}=7x^{2}.\) Since \(P=1,\) we obtain \(x=1.\) So, \((n,m,P,x)=(8,4,1,1)\) is a solution. Now, let \(m=2, s=2.\) Then we readily obtain \(n=8\) and therefore \(U_{8}=7U_{2}x^{2}.\) By (2.9), it follows that \( V_{2}V_{4}=7x^{2}.\) Since \(7|V_{4},\) we get \(V_{2}\frac{V_{4}}{7}=x^{2}.\) Clearly, \(\left( V_{2},\frac{V_{4}}{7}\right) =1\) by (2.14) and (2.12). Then \(V_{2}=a^{2}, V_{4}=7b^{2}\) for some \(a,b>0.\) Since \(P=1,\) there is no integer a such that \(V_{2}=P^{2}+2=3=a^{2}.\)

If (3.25 ) holds, then by Theorem 1 given in [2] and [4], we have \(ms=3\) and \(P=1\) or 3. Since \(m>1\) and \(ms=3,\) it follows that \( m=3.\) This implies that \(U_{3}=7U_{3}x^{2},\) which is impossible.

If \(\left( U_{ms}/U_{m},V_{ms}\right) =2,\) then either

$$\begin{aligned} U_{ms}=2U_{m}a^{2},\text { }V_{ms}=14b^{2} \end{aligned}$$
(3.26)

or

$$\begin{aligned} U_{ms}=14U_{m}a^{2},\text { }V_{ms}=2b^{2}. \end{aligned}$$
(3.27)

Clearly, (3.26) is excluded by Theorem 13. Suppose (3.27) is satisfied. Then by Theorem 2 given in [2] and [4], we have \(ms=6\) and \(P=1,5.\) Since \(m>1,\) it follows that \(m=2,3\) or 6. If \( m=2,\) then \(U_{6}=14U_{2}a^{2},\) implying that \(\left( P^{2}+1\right) \left( P^{2}+3\right) =14a^{2}\) which is impossible in integers for the case when \( P=1,5.\) If \(m=3,\) then \(U_{6}=14U_{3}a^{2},\) implying that \(\left( P^{3}+3P\right) =14a^{2},\) which is impossible. Lastly, if \(m=6,\) then \( U_{6}=14U_{6}a^{2},\) implying that \(1=14a^{2},\) which is also impossible.

Case II: t is odd. Since \(n=mt\) and n is even, it follows that m is even. Let \(m=2s.\) Then \(n=2st\) and so by (2.9), we get \( U_{n}=U_{2st}=U_{st}V_{st}=7U_{2st}x^{2}=7U_{st}V_{st}x^{2}.\) This implies that \(\frac{U_{st}}{U_{s}}\frac{V_{st}}{V_{s}}=7x^{2}.\) Clearly, \(d=\left( \frac{U_{st}}{U_{s}},\frac{V_{st}}{V_{s}}\right) =1\) or 2.

Let \(d=1.\) Then either

$$\begin{aligned} U_{st}=U_{s}a^{2},\text { }V_{st}=7V_{s}b^{2} \end{aligned}$$
(3.28)

or

$$\begin{aligned} U_{st}=7U_{s}a^{2},\text { }V_{st}=V_{s}b^{2}. \end{aligned}$$
(3.29)

Suppose (3.28) is satisfied. Then by Theorem 15, we get \(s=1\) and \(st=3.\) This implies that \(U_{3}=U_{1}a^{2},\) that is \(P^{2}+1=a^{2},\) which is impossible. Suppose (3.29) is satisfied. Then by Theorem 10, we obtain \(st=3, s=1,\) and \(P=1\) or \(st=s.\) If \(st=3, s=1,\) and \(P=1,\) then from \(U_{st}=7U_{s}a^{2},\) we have \(U_{3}=7U_{1}a^{2},\) leading to \( 2=7a^{2}, \) which is impossible. If \(st=s,\) then again from \( U_{st}=7U_{s}a^{2},\) we have \(1=7a^{2},\) which is impossible.

Let \(d=2.\) Then either

$$\begin{aligned} U_{st}=2U_{s}a^{2},\text { }V_{st}=14V_{s}b^{2} \end{aligned}$$
(3.30)

or

$$\begin{aligned} U_{st}=14U_{s}a^{2},\text { }V_{st}=2V_{s}b^{2}. \end{aligned}$$
(3.31)

Assume that (3.30) is satisfied. Then, by Theorem 6 given in [9], the only possible values of Pst,  and s for which \( U_{st}=2U_{s}a^{2}\) are \(st=3, s=2, P=1; st=6, s=2, P=1; st=12, s=3, P=1; st=12, s=6, P=1;\) or \(st=12, s=6, P=5.\) A simple computation shows that \(V_{st}=14V_{s}b^{2}\) is impossible under all the conditions that when \(P=1.\) If \(P=5,\) then, this is impossible for the case when 7|P or if \(P^{2}\equiv 1,2 \left( \text{ mod } \text { }7\right) .\) On the other hand, since \(7|V_{st},\) it follows from Lemma 6 that \( st=3r \) with r odd for the case when \(P^{2}\equiv 4 \left( \text{ mod } \text { }7\right) .\) This means that st is odd. But this contradicts the fact that \(st=12\) is even. Assume that (3.31) is satisfied. Then by Theorem 12 given in [9], we get \(s=1\) and \(P=1.\) Since \( m=2s,\) it follows that \(m=2.\) Substituting this value of m into \( U_{n}=7U_{m}x^{2}\) gives \(U_{n}=7U_{2}x^{2}=7x^{2}.\) By Theorem 16, the equation \(U_{n}=7x^{2}\) is possible if and only if \(n=2.\) As a consequence \(m=2\) and \(n=2.\) But this is impossible since \(n\ne m.\) This completes the proof. \(\square \)