1 Introduction

Let P and Q be nonzero integers. Generalized Fibonacci sequence \((U_{n})\) and Lucas sequence \((V_{n})\) are defined by \(U_{0}(P,Q)=0,U_{1}(P,Q)=1\); \(V_{0}(P,Q)=2,V_{1}(P,Q)=P,\) and \(U_{n+1}(P,Q)=PU_{n}(P,Q)+QU_{n-1}(P,Q)\), \( V_{n+1}(P,Q)=PV_{n}(P,Q)+QV_{n-1}(P,Q)\) for \(n\ge 1.\) \(U_{n}(P,Q)\) and \( V_{n}(P,Q)\) are called n-th generalized Fibonacci number and n-th generalized Lucas number, respectively. Generalized Fibonacci and Lucas numbers for negative subscripts are defined as \( U_{-n}(P,Q)=-(-Q)^{-n}U_{n}(P,Q)\) and \(V_{-n}(P,Q)=(-Q)^{-n}V_{n}(P,Q),\) respectively.

Since

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

it will be assumed that \(P\ge 1.\) Moreover, we will assume that \( P^{2}+4Q>0. \) For \(P=Q=1,\) we have classical Fibonacci and Lucas sequences \( (F_{n})\) and \((L_{n}).\) For \(P=2\) and \(Q=1,\) we have Pell and Pell-Lucas sequences \((P_{n})\) and \((Q_{n}).\) For more information about generalized Fibonacci and Lucas sequences one can consult [14].

Generalized Fibonacci and Lucas numbers of the form \(kx^{2}\) have been investigated since 1962. In [5], the authors solved \( U_{n}=x^{2},V_{n}=x^{2},U_{n}=2x^{2},\) and \(V_{n}=2x^{2}\) for odd relatively prime integers P and Q. The reader can consult [6] or [7] for a brief discussion of the subject.

In [8], the authors showed that when \(a\ne 0\) and b are integers, then the equation \(U_{n}(P,\pm 1)=ax^{2}+b\) has only a finite number of solutions n. In [9], Keskin solved the equations \( V_{n}(P,-1)=wx^{2}+1\) and \(V_{n}(P,-1)=wx^{2}-1\) for \(w=1,2,3,6\) when P is odd. In [10], Karaatlı and Keskin solved the equations \( V_{n}(P,-1)=5x^{2}\pm 1\) and \(V_{n}(P,-1)=7x^{2}\pm 1\). Similar equations are tackled in [11] by using very different methods (see also [1214]). In this study, we solve the equation \(U_{n}(P,-1)=wx^{2}+1\) for \(w=1,2,3,5,6,7,10.\)

We will use the Jacobi symbol throughout this study. Our method is elementary and used by Cohn, Ribenboim and McDaniel in [15] and [16] , respectively.

2 Preliminaries

From now on, instead of \(U_{n}(P,-1)\) and \(V_{n}(P,-1),\) we sometimes write \( U_{n}\) and \(V_{n},\) respectively. Moreover, we will assume that \(P\ge 3\).

The following lemmas can be proved by induction.

Lemma 2.1

If n is a positive integer, then \(U_{2n}\equiv n(-1)^{n+1}P\) \(( \mathrm{mod}P^{2})\) and \(U_{2n+1}\equiv (-1)^{n}\) \((\mathrm{mod}P^{2}).\)

Lemma 2.2

If n is a positive integer, then \(V_{2n}\equiv 2(-1)^{n}\) \(( \mathrm{mod}P^{2})\) and \(V_{2n+1}\equiv (-1)^{n}(2n+1)P\) \((\mathrm{mod}P^{2}).\)

The following theorems are given in [9].

Theorem 2.3

Let P be odd. If \(V_{n}=kx^{2}\) for some k|P with \(k>1,\) then \(n=1.\)

Theorem 2.4

Let P be odd. If \(V_{n}=2kx^{2}\) for some k|P with \(k>1,\) then \(n=3.\)

Theorem 2.5

Let P be odd. If \(U_{n}=kx^{2}\) for some k|P with \(k>1,\) then \( n=2\) or \(n=6\) and 3|P.

Theorem 2.6

Let P be odd. If k|P with \(k>1,\) then the equation \( U_{n}=2kx^{2}\) has no solutions.

Theorem 2.7

Let P be odd. If k|P with \(k>1,\) then the equation \( U_{n}=kx^{2}+1\) has only the solution \(n=1.\)

The following theorem is given in [10].

Theorem 2.8

Let P be odd. If \(V_{n}=7kx^{2}\) for some k|P with \(k>1,\) then \(n=1.\)

Now we give some known theorems from [5], which will be useful for solving the equation \(U_{n}=wx^{2}+1.\) We use a theorem from [17] while solving \(V_{n}=2x^{2}.\)

Theorem 2.9

Let P be odd. If \(V_{n}=x^{2}\) for some integer x,  then \(n=1.\) If \(V_{n}=2x^{2}\) for some integer x,  then \(n=3,P=3,27.\)

Theorem 2.10

Let P be odd. If \(U_{n}=x^{2}\) for some integer x,  then \(n=1\) or \(n=2,\) \(P=\square \) or \(n=6,P=3.\) If \(U_{n}=2x^{2}\) for some integer x,  then \(n=3.\)

The following lemma is a consequence of a theorem given in [18].

Lemma 2.11

All positive integer solutions of the equation \(3x^{2}-2y^{2}=1\) are given by \( (x,y)=(U_{n}(10,-1)-U_{n-1}(10,-1),U_{n}(10,-1)+U_{n-1}(10,-1)) \) with \( n\ge 1.\)

The proof of the following lemma is easy and will be omitted.

Lemma 2.12

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

The following theorems are well known (see [1922]).

Lemma 2.13

All positive integer solutions of the equation \( x^{2}-(P^{2}-4)y^{2}=4\) are given by \((x,y)=\left( V_{n}(P,-1),U_{n}(P,-1)\right) \) with \(n\ge 1.\)

Lemma 2.14

All positive integer solutions of the equation \( x^{2}-Pxy+y^{2}=1 \) are given by \((x,y)=\left( U_{n}(P,-1),U_{n-1}(P,-1)\right) \) with \(n\ge 2.\)

The following two theorems are given in [23].

Theorem 2.15

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}\,\left( \mathrm{mod}U_{m}\right) . \end{aligned}$$
(2.1)

Theorem 2.16

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}\,\left( \mathrm{mod} V_{m}\right) . \end{aligned}$$
(2.2)

If \(n=2\cdot 2^{k}a+r\) with a odd, then we get

$$\begin{aligned} U_{n}=U_{2\cdot 2^{k}a+r}\equiv -U_{r}\,(\mathrm{mod}V_{2^{k}}). \end{aligned}$$
(2.3)

by (2.2).

When P is odd, since \(8|U_{3},\) using (2.1) we get

$$\begin{aligned} U_{6q+r}\equiv U_{r}\,\left( \mathrm{mod}U_{3}\right) \end{aligned}$$
(2.4)

and therefore

$$\begin{aligned} U_{6q+r}\equiv U_{r}\,\left( \mathrm{mod}8\right) . \end{aligned}$$
(2.5)

From Lemma 2.1 and Lemma 2.2, it follows that if q|P with \( q>1, \) then

$$\begin{aligned}&q|V_{n}\Leftrightarrow n\text { is odd and }q|U_{n}\Leftrightarrow n\text { is even.} \end{aligned}$$
(2.6)
$$\begin{aligned}&\quad \text {If }P^{2}\equiv -1\,(\mathrm{mod}5),\quad \text { then }5|U_{5}. \end{aligned}$$
(2.7)
$$\begin{aligned}&\quad \text {If }P\text { is odd, then }2|V_{n}\Leftrightarrow 2|U_{n}\Leftrightarrow 3|n. \end{aligned}$$
(2.8)

Now we give some identities concerning generalized Fibonacci and Lucas numbers:

$$\begin{aligned} U_{-n}= & {} -U_{n}\text { and }V_{-n}=V_{n},\nonumber \\ U_{2n+1}-1= & {} U_{n}V_{n+1}, \end{aligned}$$
(2.9)
$$\begin{aligned} U_{2n}= & {} U_{n}V_{n}, \end{aligned}$$
(2.10)
$$\begin{aligned} V_{n}^{2}-(P^{2}-4)U_{n}^{2}= & {} 4, \end{aligned}$$
(2.11)
$$\begin{aligned} V_{2n}= & {} V_{n}^{2}-2. \end{aligned}$$
(2.12)

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

$$\begin{aligned} \left( U_{m},V_{n}\right) =\left\{ \begin{array}{c} V_{d}~\quad \,\quad \text { if }a>b, \\ 1\text { or }2 \quad \text { if }a\le b. \end{array} \right. \end{aligned}$$
(2.13)

From (2.11) and Lemma 2.2, it follows that

$$\begin{aligned} 5|V_{n}\Leftrightarrow 5|P\text { and }n\text { is odd}. \end{aligned}$$
(2.14)

An induction method shows that

$$\begin{aligned} V_{2^{k}}\equiv 7\,(\mathrm{mod}8)\, \end{aligned}$$

and thus

$$\begin{aligned} \left( \frac{2}{V_{2^{k}}}\right) =1 \end{aligned}$$
(2.15)

and

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

for all \(k\ge 1.\)

Lemma 2.17

Let P be odd. Then

$$\begin{aligned} \left( \frac{P-1}{V_{2^{k}}}\right) =\left( \frac{P+1}{V_{2^{k}}}\right) =1 \end{aligned}$$
(2.17)

for all \(k\ge 1.\) Moreover, if \(3\not \mid P,\) then

$$\begin{aligned} \left( \frac{3}{V_{2^{k}}}\right) =1 \end{aligned}$$
(2.18)

for all \(k\ge 1.\)

Proof

If \(3\not \mid P,\) then \(P^{2}\equiv 1\) \((\mathrm{mod}3)\) and therefore \( V_{2}=P^{2}-2\equiv -1\) \((\mathrm{mod}3).\) An induction method shows that \( V_{2^{k}}\equiv -1\) \((\mathrm{mod}3)\) since \(V_{2^{k}}=\left( V_{2^{k-1}}\right) ^{2}-2\) by (2.12). Thus

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

Since \(V_{2}=P^{2}-2\equiv -1\) \((\mathrm{mod}P^{2}-1),\) it follows that \( V_{2^{k}}\equiv -1\) \((\mathrm{mod}P^{2}-1).\) Thus \(V_{2^{k}}\equiv -1\) \((\mathrm{ mod}P-1)\) and \(V_{2^{k}}\equiv -1\) \((\mathrm{mod}P+1).\) Let \(P-1=2^{t}a\) with a odd. Then we get

$$\begin{aligned} \left( \frac{P-1}{V_{2^{k}}}\right) =\left( \frac{2^{t}a}{V_{2^{k}}}\right) =\left( \frac{2}{V_{2^{k}}}\right) ^{t}\left( \frac{a}{V_{2^{k}}}\right) =\left( \frac{a}{V_{2^{k}}}\right) =\left( -1\right) ^{\frac{a-1}{2}}\left( \frac{V_{2^{k}}}{a}\right) \end{aligned}$$
(2.19)

since \(\left( \frac{2}{V_{2^{k}}}\right) =1\) by (2.15). By using the fact that \(V_{2^{k}}\equiv -1\) \((\mathrm{mod}a),\) we get \(\left( \frac{P-1}{ V_{2^{k}}}\right) =\left( -1\right) ^{\frac{a-1}{2}}\left( \frac{-1}{a} \right) =1\) by (2.19). Similarly, it is seen that \(\left( \frac{P+1}{ V_{2^{k}}}\right) =1.\) \(\square \)

When P is odd, it can be shown that

$$\begin{aligned} \left( \frac{5}{V_{2^{k}}}\right) =\left\{ \begin{array}{c} \,-1\quad \text { if }P^{2}\equiv -1\,(\mathrm{mod}5), \\ 1\quad \text { if }P^{2}\equiv 1\,(\mathrm{mod}5) \end{array} \right. \end{aligned}$$
(2.20)

and

$$\begin{aligned} \left( \frac{7}{V_{2^{k}}}\right) =\left\{ \begin{array}{c} -1\quad \text {if }P^{2}\equiv 4\,(\mathrm{mod}7), \\ 1\quad \,\,\text {if }P^{2}\equiv 1\,(\mathrm{mod}7) \end{array} \right. \end{aligned}$$
(2.21)

for all \(k\ge 1.\)

3 Main theorems

From now on, we will assume that n is a positive integer and P is an odd integer.

Theorem 3.1

If \(U_{n}=2kx^{2}+1\) with k|P and \(k>1,\) then \(n=1\) or \(n=5.\)

Proof

Assume that \(U_{n}=2kx^{2}+1\) for some integer x. Then n is odd by Lemma 2.1. It is clear that \(n=1\) is a solution. Assume that \(n>1.\) Then we have \(n=2m+1\) with \(m\ge 1.\) Thus, we get \( U_{m}V_{m+1}=U_{2m+1}-1=2kx^{2}\) by (2.9). It can be seen that m is even by (2.6). Thus, \((U_{m},V_{m+1})=P\) by (2.13). Then it follows that

$$\begin{aligned} U_{m}=k_{1}Pa^{2}\quad \text { and }\quad V_{m+1}=2k_{2}Pb^{2} \end{aligned}$$

or

$$\begin{aligned} U_{m}=2k_{1}Pa^{2}\quad \text { and }\quad V_{m+1}=k_{2}Pb^{2} \end{aligned}$$

for some natural numbers a and b with \(k=k_{1}k_{2}.\) Thus, it is seen that

$$\begin{aligned} U_{m}=ut^{2}\text { and }V_{m+1}=2vs^{2} \end{aligned}$$
(3.1)

or

$$\begin{aligned} U_{m}=2ut^{2}\quad \text { and }\quad V_{m+1}=vs^{2} \end{aligned}$$
(3.2)

for some natural numbers uvst with u|P and v|P. Assume that (3.1) is satisfied. By using Theorems 2.4 and 2.10, it is seen that \(m=2.\) Therefore \(n=5.\) The identity (3.2) is impossible by Theorems 2.6 and 2.10.

Theorem 3.2

Let \(w=1,2,3,6.\) If \(U_{n}=wx^{2}+1\) for some integer x, then \( (w,n)=(1,1),(1,2),(2,1),(2,2),(3,1),(3,2),(6,1),(6,2),(6,5).\)

Proof

Assume that \(U_{n}=wx^{2}+1\) for some integer x. Let \(n>3\). Then \(n=4q+r\) for some \(q>0\) with \(0\le r\le 3\). Then \(n=2\cdot 2^{k}a+r\) with a odd and \(k\ge 1.\) Thus,

$$\begin{aligned} wx^{2}=-1+U_{n}\equiv -1-U_{r}\,(\mathrm{mod}V_{2^{k}}) \end{aligned}$$

by (2.3). This shows that

$$\begin{aligned} wx^{2}\equiv -1,-2,-(P+1),-P^{2}\,(\mathrm{mod}V_{2^{k}}). \end{aligned}$$

Since \(\left( \dfrac{2}{V_{2^{k}}}\right) =1\), \(\left( \dfrac{-1}{V_{2^{k}}} \right) =-1,\) and \(\left( \dfrac{P+1}{V_{2^{k}}}\right) =1\) by (2.15), (2.16), and (2.17), respectively, we get

$$\begin{aligned} \left( \dfrac{w}{V_{2^{k}}}\right) =-1. \end{aligned}$$
(3.3)

If \(w=1,2,\) then (3.3) is impossible. Let \(w=3,6.\) If \(3\not \mid P\), then again (3.3) is impossible since \(\left( \dfrac{3}{V_{2^{k}}} \right) =1\) by (2.18). Therefore \(n\le 3\) in case \(3\not \mid P\) and \( w=3,6.\) But \(n=3\) is not a solution in this case. If \(w=6\) and 3|P, then by Theorem 3.1, we get \(n=1\) or \(n=5.\) Thus, \(n=1,5\) for the case \(w=6\) and 3|P. If \(w=3\) and 3|P, then by Theorem 2.7, we get \(n=1.\)

\(\square \)

Theorem 3.3

If \(U_{n}=5x^{2}+1\) for some integer x,  then \(n=1\) or \(n=2.\)

Proof

Assume that \(U_{n}=5x^{2}\) \(+1\) for some integer x. If 5|P,  then by Theorem 2.7, \(n=1.\) Assume that \(5\not \mid P\). Let \(n>2\) and n be even. Now we divide the proof into two cases.

Case I. Let \(\ P^{2}\equiv 1\) \((\mathrm{mod}5).\) Since n is even, \( n=4q+r\) for some positive integer q with \(r=0,2.\) Thus, \(n=2\cdot 2^{k}a+r\) with a odd and \(k\ge 1.\) Then

$$\begin{aligned} 5x^{2}=-1+U_{n}\equiv -1-U_{r}\,(\mathrm{mod}V_{2^{k}}) \end{aligned}$$

by (2.3). This shows that

$$\begin{aligned} 5x^{2}\equiv -1,-(P+1)\,(\mathrm{mod}V_{2^{k}}), \end{aligned}$$

which is impossible since \(\left( \dfrac{-1}{V_{2^{k}}}\right) =-1\), \(\left( \dfrac{P+1}{V_{2^{k}}}\right) =1\), and \(\left( \dfrac{5}{V_{2^{k}}}\right) =1 \) by (2.16), (2.17), and (2.20), respectively.

Case II. Let \(\ P^{2}\equiv -1\) \((\mathrm{mod}5)\). We get \( 5x^{2}\equiv -1\) \((\mathrm{mod}P)\) since \(P|U_{n}\) when n is even. This shows that

$$\begin{aligned} -1=\left( \dfrac{P}{5}\right) =\left( \dfrac{5}{P}\right) =\left( \dfrac{-1}{ P}\right) , \end{aligned}$$

which implies that \(P\equiv 3,7\) \((\mathrm{mod}8)\). Since n is even, we get \( n=6q+r\), \(r=0,2,4.\) Then \(5x^{2}+1\) \(\equiv U_{r}\) \((\mathrm{mod}8)\) by (2.5). If \(r=0,\) then we get \(5x^{2}\) \(\equiv -1\) \((\mathrm{mod}8),\) which is impossible. Let \(r=2\). Then \(5x^{2}\) \(+1\equiv U_{2}\) \((\mathrm{mod}8)\) by (2.5), which shows that \(5x^{2}\) \(+1\equiv P\) \((\mathrm{mod}8).\) But this is impossible since \(P\equiv 3,7\) \((\mathrm{mod}8).\) Let \(r=4\). Then \(n=12t+4\) or \(n=12t+10\) for some integer t. Let \(n=12t+10\). Then \(n=12q_{1}-2\) with \( q_{1}>0.\) Thus, \(n=2\cdot 2^{k}a-2\) with a odd and \(k\ge 1.\) Then it follows that

$$\begin{aligned} 5x^{2}=-1+U_{n}\equiv -1-U_{-2}\,(\mathrm{mod}V_{2^{k}}) \end{aligned}$$

by (2.3), which implies that

$$\begin{aligned} 5x^{2}\equiv P-1\,(\mathrm{mod}V_{2^{k}}). \end{aligned}$$

This is impossible since \(\left( \dfrac{P-1}{V_{2^{k}}}\right) =1\) and \( \left( \dfrac{5}{V_{2^{k}}}\right) =-1\) by (2.17) and (2.20), respectively. Let \(n=12t+4.\) Since \(16|U_{6},\) we get \(5x^{2}+1=U_{n}\equiv U_{4}\) \((\mathrm{mod}16)\) by (2.1). A simple computation shows that \( 5x^{2}+1\equiv 1,5,6,14\) \((\mathrm{mod}16)\) and therefore \(U_{4}\equiv 1,5,6,14 \) \((\mathrm{mod}16)\). Moreover, we have \(5x^{2}+1=U_{n}\equiv U_{4}\equiv -P\) \( (\mathrm{mod}8)\) by (2.5). Using the fact that \(5x^{2}+1\equiv 1,5,6,14\) \((\mathrm{mod}8),\) we see that \(P\equiv 3,7\) \((\mathrm{mod}8).\) Since \(P\equiv 3,7\) \(\ (\mathrm{mod}8)\) and \(P^{3}-2P=U_{4}\equiv 1,5,6,14\) \((\mathrm{mod}16),\) it is seen that \(P\equiv 3,15\) \((\mathrm{mod}16).\) Let \(P\equiv 3\) \((\mathrm{mod} 16)\) and \(P\equiv 3\) \((\mathrm{mod}5).\) Since n is even, \(\ n=10q+r,\) \(r\in \{0,2,4,6,8\}.\) Using \(5|U_{5},\) we get \(5x^{2}+1=U_{n}\equiv U_{r}\) \((\mathrm{ mod}5)\) by (2.1). A simple computation shows that \(r=4.\) Since \( n=10q+4\) and \(n=12t+4,\) we get \(\ n=60k+4\) for some natural number k. Thus, by using (2.2), it is seen that

$$\begin{aligned} U_{n}=U_{60k+4}\equiv U_{4}\,(\mathrm{mod}V_{5}), \end{aligned}$$

which implies that

$$\begin{aligned} 5x^{2}\equiv P^{3}-2P-1\,(\mathrm{mod}P^{4}-5P^{2}+5) \end{aligned}$$

since \(V_{5}=P(P^{4}-5P^{2}+5).\) This shows that

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

By using the facts that \((P^{3}-2P-1)/4\equiv 1\) \((\mathrm{mod}4),\) \( P^{4}-5P^{2}+5\equiv 1\) \((\mathrm{mod}5),\) \(P^{4}-5P^{2}+5\equiv 9\) \((\mathrm{mod }16),\) and \(-3P^{2}+P+5\equiv 13\) \((\mathrm{mod}16),\) we get

$$\begin{aligned} 1= & {} \left( \dfrac{5}{P^{4}-5P^{2}+5}\right) =\left( \dfrac{P^{4}-5P^{2}+5}{ (P^{3}-2P-1)/4}\right) =\left( \dfrac{-3P^{2}+P+5}{(P^{3}-2P-1)/4}\right) \\= & {} \left( \dfrac{(P^{3}-2P-1)/4}{-3P^{2}+P+5}\right) =\left( \dfrac{ P^{3}-2P-1}{-3P^{2}+P+5}\right) =\left( \dfrac{9(P^{3}-2P-1)}{-3P^{2}+P+5} \right) \\= & {} \left( \dfrac{-2(P+2)}{-3P^{2}+P+5}\right) =\left( \dfrac{-2}{-3P^{2}+P+5} \right) \left( \dfrac{P+2}{-3P^{2}+P+5}\right) \\= & {} -\left( \dfrac{P+2}{-3P^{2}+P+5}\right) =-\left( \dfrac{-3P^{2}+P+5}{P+2} \right) =-\left( \dfrac{-1}{P+2}\right) =-1, \end{aligned}$$

a contradiction. Let \(P\equiv 3\) \((\mathrm{mod}16)\) and \(P\equiv 2\) \((\mathrm{mod }5).\) Then \((P-1)/2\equiv 3\) \((\mathrm{mod}5)\) and \((P-1)/2\equiv 1\) \((\mathrm{ mod}8)\) and therefore

$$\begin{aligned} \left( \dfrac{5}{(P-1)/2}\right) =-1\text { and }\left( \dfrac{-2}{(P-1)/2} \right) =1. \end{aligned}$$
(3.4)

Moreover,

$$\begin{aligned} 5x^{2}=-1+U_{n}=-1+U_{12t+4}\equiv -1+U_{4}\equiv P^{3}-2P-1\,(\mathrm{ mod}U_{3}) \end{aligned}$$

by (2.1). This implies that

$$\begin{aligned} 5x^{2}\equiv P^{3}-2P-1\,(\mathrm{mod}P-1). \end{aligned}$$

This shows that

$$\begin{aligned} 5x^{2}\equiv -2\,(\mathrm{mod}(P-1)/2), \end{aligned}$$

which is impossible by (3.4). Let \(P\equiv 15\) \((\mathrm{mod}16).\) Then \( (P^{2}-3)/2\equiv 3\) \((\mathrm{mod}5)\) and \((P^{2}-3)/2\equiv 7\) \((\mathrm{mod} 8).\) Moreover, we get

$$\begin{aligned} 5x^{2}=-1+U_{n}=-1+U_{12t+4}\equiv -1+U_{4}\equiv P^{3}-2P-1\,(\mathrm{ mod}V_{3}) \end{aligned}$$

by (2.2). This shows that

$$\begin{aligned} 5x^{2}\equiv P-1\,(\mathrm{mod}(P^{2}-3)/2) \end{aligned}$$

and therefore

$$\begin{aligned} \left( \dfrac{5}{(P^{2}-3)/2}\right) =\left( \dfrac{P-1}{(P^{2}-3)/2}\right) . \end{aligned}$$

This is impossible since

$$\begin{aligned} -1= & {} \left( \dfrac{(P^{2}-3)/2}{5}\right) =\left( \dfrac{5}{(P^{2}-3)/2} \right) =\left( \dfrac{(P-1)/2}{(P^{2}-3)/2}\right) \left( \dfrac{2}{ (P^{2}-3)/2}\right) \\= & {} \left( \dfrac{(P-1)/2}{(P^{2}-3)/2}\right) =-\left( \dfrac{(P^{2}-3)/2}{ (P-1)/2}\right) =-\left( \dfrac{-1}{(P-1)/2}\right) =1. \end{aligned}$$

Now assume that \(n>3\) and n is odd. Then \(n=2m+1\) with \(m>1.\) Therefore \( U_{2m+1}=5x^{2}+1,\) which implies that \(5x^{2}=U_{2m+1}-1=U_{m}V_{m+1}\) by ( 2.9). Let m be odd. Then \((U_{m},V_{m+1})=1\) by (2.13) and ( 2.8). Thus,

$$\begin{aligned} U_{m}=a^{2} \quad \text { and }\quad V_{m+1}=5b^{2} \end{aligned}$$
(3.5)

or

$$\begin{aligned} U_{m}=5a^{2}\quad \text { and }\quad V_{m+1}=b^{2} \end{aligned}$$
(3.6)

for some integers a and b. The identities (3.5) and (3.6) are impossible by (2.14) and Theorem 2.9, respectively. Let m be even. Then \((U_{m},V_{m+1})=P\) by (2.13). Thus,

$$\begin{aligned} U_{m}=Pa^{2}\text { and }V_{m+1}=5Pb^{2} \end{aligned}$$
(3.7)

or

$$\begin{aligned} U_{m}=5Pa^{2}\text { and }V_{m+1}=Pb^{2} \end{aligned}$$
(3.8)

for some integers a and b. The identities (3.7) and (3.8) are impossible by (2.14) and Theorem 2.3, respectively. Therefore \(n\le 3\). If \(n=3,\) we get \(P^{2}-1=U_{3}=5x^{2}+1,\) which implies that \( P^{2}\equiv 2\) \((\mathrm{mod}5).\) This is impossible. Thus, \(n=1\) or \(n=2.\) \(\square \)

Theorem 3.4

If \(U_{n}=7x^{2}+1\) for some integer x,  then \(n=1,2,3.\)

Proof

Assume that \(U_{n}=7x^{2}\) \(+1\) for some integer x. If \(7|P,\ \) then by Theorem 2.7, \(n=1.\) Assume that \(7\not \mid P\). Let \(n>2\) and n be even. Then \(7x^{2}+1\equiv 0\) \((\mathrm{mod}P).\) This shows that \(\left( \dfrac{7}{P} \right) =\left( \dfrac{-1}{P}\right) ,\) which implies that \(\left( \dfrac{P}{ 7}\right) =1\). Therefore \(P\equiv 1,2,4\) \((\mathrm{mod}7).\) Now we distinguish three cases.

Case I. Let \(P\equiv 1\) \((\mathrm{mod}7).\) Since n is even, \(n=4q+r\) for some \(q>0\) with \(r=0,2.\) Thus, \(n=2\cdot 2^{k}a+r\) with a odd and \( k\ge 1.\) Then we get

$$\begin{aligned} 7x^{2}=-1+U_{n}\equiv -1-U_{r}\,(\mathrm{mod}V_{2^{k}}) \end{aligned}$$

by (2.3), which implies that

$$\begin{aligned} 7x^{2}\equiv -1,-(P+1)\,(\mathrm{mod}V_{2^{k}}). \end{aligned}$$

This is impossible since \(\left( \dfrac{-1}{V_{2^{k}}}\right) =-1\), \(\left( \dfrac{P+1}{V_{2^{k}}}\right) =1,\) and \(\left( \dfrac{7}{V_{2^{k}}}\right) =1 \) by (2.16), (2.17), and (2.21), respectively.

Case II. Let \(P\equiv 4\) \((\mathrm{mod}7).\) Then \(7|V_{2}\) and

$$\begin{aligned} 7x^{2}=-1+U_{n}=-1+U_{4q+r}\equiv -1\pm U_{r}\,(\mathrm{mod}V_{2}) \end{aligned}$$

by (2.2). This is impossible since \(7\not \mid (-1\pm U_{r})\) for \(r=0,2.\)

Case III. Let \(P\equiv 2\) \((\mathrm{mod}7).\) If \(n=4q+2,\) then \( n=4(q+1)-2=2\cdot 2^{k}a-2\) with a odd and \(k\ge 1.\) Thus, we get

$$\begin{aligned} 7x^{2}=-1+U_{n}\equiv -1-U_{-2}\,(\mathrm{mod}V_{2^{k}}) \end{aligned}$$

by (2.3), which implies that

$$\begin{aligned} 7x^{2}\equiv P-1\,(\mathrm{mod}V_{2^{k}}). \end{aligned}$$

But this is impossible since \(\left( \dfrac{P-1}{V_{2^{k}}}\right) =1\) and \( \left( \dfrac{7}{V_{2^{k}}}\right) =-1\) by (2.17) and (2.21), respectively. Let \(n=4q.\) Then \(n=12t+r\) with \(r=0,4,8.\) Assume that \(n=12t.\) Since P is odd, we can write \(P^{2}-1=2^{m}a\) with a odd. Thus,

$$\begin{aligned} 7x^{2}=-1+U_{n}\equiv -1+U_{0}\,(\mathrm{mod}U_{3}) \end{aligned}$$

by (2.1), which implies that

$$\begin{aligned} 7x^{2}\equiv -1\,(\mathrm{mod}a). \end{aligned}$$

This shows that \(\left( \dfrac{7}{a}\right) =\left( \dfrac{-1}{a}\right) \) and therefore \(\left( \dfrac{a}{7}\right) =1.\) Thus,

$$\begin{aligned} 1=\left( \dfrac{a}{7}\right) =\left( \dfrac{2^{m}a}{7}\right) =\left( \dfrac{ P^{2}-1}{7}\right) =\left( \dfrac{3}{7}\right) =-1, \end{aligned}$$

a contradiction. Assume that \(n=12t+4.\) Since \(16|U_{6},\) we get \( U_{n}\equiv U_{4}\) \((\mathrm{mod}16)\) by (2.1). This shows that \( 7x^{2}+1\equiv P^{3}-2P\) \((\mathrm{mod}16).\) Since \(7x^{2}+1\equiv 0,1,8,13\) \(( \mathrm{mod}16)\), a simple computation shows that \(P\equiv 11,15\) \((\mathrm{mod} 16).\) Let \(P\equiv 11\) \((\mathrm{mod}16).\) Then

$$\begin{aligned} 7x^{2}=-1+U_{n}=-1+U_{12t+4}\equiv -1+U_{4}\equiv P^{3}-2P-1\,(\mathrm{ mod}U_{3}) \end{aligned}$$

by (2.1), which shows that \(7x^{2}\equiv -2\) \((\mathrm{mod}P-1).\) Thus, we get \(\left( \dfrac{7}{(P-1)/2}\right) =\) \(\left( \dfrac{-2}{(P-1)/2} \right) \) and therefore \(\left( \dfrac{(P-1)/2}{7}\right) =\) \(\left( \dfrac{2 }{(P-1)/2}\right) .\) But this is impossible since \((P-1)/2\equiv 5\) \((\mathrm{ mod}8)\) and \((P-1)/2\equiv 4\) \((\mathrm{mod}7).\) Let \(P\equiv 15\) \((\mathrm{mod} 16).\) By using a similar argument, it is seen that \(7x^{2}\equiv P-1\) \(( \mathrm{mod}P^{2}-3).\) This shows that

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

Since \((P^{2}-3)/2\equiv 4\) \((\mathrm{mod}7)\), \((P^{2}-3)/2\equiv 7\) \((\mathrm{ mod}8),\) and \((P-1)/2\equiv 7\) \((\mathrm{mod}8),\) we get

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

a contradiction. Assume that \(n=12t+8.\) Then we can write \(n=12m-4.\) A simple computation shows that \(P\equiv 1,5\) \((\mathrm{mod}16)\) in this case. Let \(P\equiv 1\) \((\mathrm{mod}16).\) Then

$$\begin{aligned} 7x^{2}=-1+U_{n}=-1+U_{12m-4}\equiv -1+U_{-4}\equiv -(P^{3}-2P+1)\,( \mathrm{mod}U_{3}), \end{aligned}$$

which implies that \(7x^{2}\equiv -2\) \((\mathrm{mod}P+1).\) Thus, we get

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

Therefore by using the facts that \((P+1)/2\equiv 1\) \((\mathrm{mod}8)\) and \( (P+1)/2\equiv 5\) \((\mathrm{mod}7),\) we get

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

a contradiction. Let \(P\equiv 5\) \((\mathrm{mod}16).\) Then

$$\begin{aligned} 7x^{2}=-1+U_{n}=-1+U_{12m-4}\equiv -1+U_{-4}\equiv -(P^{3}-2P+1)\,( \mathrm{mod}V_{3}) \end{aligned}$$

by (2.2), which implies that \(7x^{2}\equiv -(P+1)\) \((\mathrm{mod} P^{2}-3).\) By using the facts that \((P^{2}-3)/2\equiv 4\) \((\mathrm{mod}7)\), \( (P^{2}-3)/2\equiv 3\) \((\mathrm{mod}8),\) and \((P+1)/2\equiv 3\) \((\mathrm{mod}8),\) we get

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

a contradiction. Thus, we conclude that \(n\le 2.\) Now assume that n is odd. Then \(n=2m+1\) with \(m\ge 0.\) Thus, \(U_{2m+1}=7x^{2}+1,\) which implies that \(7x^{2}=U_{2m+1}-1=U_{m}V_{m+1}\) by (2.9). Let m be odd. Then \((U_{m},V_{m+1})=1\) by (2.13) and (2.8). Thus,

$$\begin{aligned} U_{m}=a^{2}\quad \text { and }\quad V_{m+1}=7b^{2} \end{aligned}$$
(3.9)

or

$$\begin{aligned} U_{m}=7a^{2}\quad \text { and }\quad V_{m+1}=b^{2} \end{aligned}$$
(3.10)

for some integers a and b. Assume that (3.9) is satisfied. Then by Theorem 2.10, we get \(m=1\) and therefore \(n=3.\) The identity (3.10) is impossible by Theorem 2.9. Let m be even. Then \( (U_{m},V_{m+1})=P\) by (2.13). This implies that

$$\begin{aligned} U_{m}=Pa^{2}\text { and }V_{m+1}=7Pb^{2} \end{aligned}$$
(3.11)

or

$$\begin{aligned} U_{m}=7Pa^{2}\text { and }V_{m+1}=Pb^{2}. \end{aligned}$$
(3.12)

for some integers a and b. By using Theorems 2.3 and 2.8, we have in both cases that \(m+1=1\) and therefore \(n=1.\) Consequently, we have \( n=1,2,3.\) \(\square \)

Theorem 3.5

If \(U_{n}=10x^{2}+1\) for some integer x,  then \(n=1,2.\)

Proof

If 5|P,  then by Theorem 3.1, \(n=1\) or \(n=5.\) Assume that \(5\not \mid P\) . Let \(n>2\) and n be even. Then \(10x^{2}+1\equiv 0\) \((\mathrm{mod}P)\) since \( P|U_{n}\) when n is even. Therefore

$$\begin{aligned} \left( \dfrac{5}{P}\right) =\left( \dfrac{-2}{P}\right) . \end{aligned}$$

If \(P\equiv \pm 1\) \((\mathrm{mod}5),\) then \(P\equiv 1,3\) \((\mathrm{mod}8).\) If \( P\equiv \pm 2\) \((\mathrm{mod}5),\) then \(P\equiv 5,7\) \((\mathrm{mod}8).\) The remainder of the proof is split into two cases.

Case I. Let \(P\equiv \pm 1\) \((\mathrm{mod}5).\) Since n is even, we get \(n=4q+r\) for some positive integer q with \(r=0,2.\) Thus, \(n=2\cdot 2^{k}a+r\) with a odd and \(k\ge 1.\) Then

$$\begin{aligned} 10x^{2}=-1+U_{n}\equiv -1-U_{r}\,(\mathrm{mod}V_{2^{k}}) \end{aligned}$$

by (2.3). This shows that

$$\begin{aligned} 10x^{2}\equiv -1,-(P+1)\,(\mathrm{mod}V_{2^{k}}), \end{aligned}$$

which is impossible since \(\left( \dfrac{2}{V_{2^{k}}}\right) =1\), \(\left( \dfrac{-1}{V_{2^{k}}}\right) =-1\), \(\left( \dfrac{P+1}{V_{2^{k}}}\right) =1,\) and \(\left( \dfrac{5}{V_{2^{k}}}\right) =1\) by (2.15), (2.16), ( 2.17), and (2.20), respectively.

Case II. Let \(P\equiv \pm 2\) \((\mathrm{mod}5).\) Since n is even, we get \(n=6q+r\) with \(r=0,2,4.\) Then \(10x^{2}+1\) \(\equiv U_{r}\) \((\mathrm{mod}8)\) by (2.5). If \(r=0,\) then we get \(10x^{2}\) \(\equiv -1\) \((\mathrm{mod}8),\) which is impossible. Let \(r=2\). Then \(10x^{2}\) \(+1\equiv U_{2}\) \((\mathrm{mod} 8)\), which shows that \(10x^{2}\) \(+1\equiv P\) \((\mathrm{mod}8),\) which is impossible since \(P\equiv 5,7\) \((\mathrm{mod}8).\) Let \(r=4.\) Then either \( n=12t+10\) or \(n=12t+4\) for some nonnegative integer t. Assume that \( n=12t+10.\) Then \(n=12q_{1}-2\) with \(q_{1}>0.\) Thus, \(n=2\cdot 2^{k}a-2\) with a odd and \(k\ge 1.\) This shows that

$$\begin{aligned} 10x^{2}\equiv -1+U_{n}\equiv -1-U_{-2}\,(\mathrm{mod}V_{2^{k}}) \end{aligned}$$

by (2.3), which shows that

$$\begin{aligned} 10x^{2}\equiv P-1\,(\mathrm{mod}V_{2^{k}}). \end{aligned}$$

This is impossible since \(\left( \dfrac{2}{V_{2^{k}}}\right) =1\), \(\left( \dfrac{P-1}{V_{2^{k}}}\right) =1,\) and \(\left( \dfrac{5}{V_{2^{k}}}\right) =-1\) by (2.15), (2.17), and (2.20), respectively. Assume that \(n=12t+4.\) It can be seen that \(U_{n}=10x^{2}+1\) \(\equiv 1,9,11\) \(( \mathrm{mod}16).\) Moreover, we get \(U_{n}\equiv U_{4}\) \((\mathrm{mod}16)\) by ( 2.1) since \(16|U_{6}.\) A simple computation shows that \(P\equiv 7,13,15 \) \((\mathrm{mod}16)\) since \(P\equiv 5,7\) \((\mathrm{mod}8)\) and \(U_{4}=P^{3}-2P.\) Let \(P\equiv 7,15\) \((\mathrm{mod}16).\) Then \((P^{2}-3)/2\equiv 3\) \((\mathrm{mod} 5)\) and \((P^{2}-3)/2\equiv 7\) \((\mathrm{mod}8).\) Moreover, we get

$$\begin{aligned} 10x^{2}=-1+U_{n}=-1+U_{12t+4}\equiv -1+U_{4}\equiv P^{3}-2P-1\,(\mathrm{ mod}V_{3}) \end{aligned}$$

by (2.2). This shows that

$$\begin{aligned} 10x^{2}\equiv P-1\,(\mathrm{mod}(P^{2}-3)) \end{aligned}$$

and therefore

$$\begin{aligned} 5x^{2}\equiv (P-1)/2\,(\mathrm{mod}(P^{2}-3)/2). \end{aligned}$$

Then we get

$$\begin{aligned} \left( \dfrac{5}{(P^{2}-3)/2}\right) =\left( \dfrac{(P-1)/2}{(P^{2}-3)/2} \right) . \end{aligned}$$

This is impossible since

$$\begin{aligned} -1= & {} \left( \dfrac{(P^{2}-3)/2}{5}\right) =\left( \dfrac{5}{(P^{2}-3)/2} \right) =\left( \dfrac{(P-1)/2}{(P^{2}-3)/2}\right) \\= & {} -\left( \dfrac{(P^{2}-3)/2}{(P-1)/2}\right) =-\left( \dfrac{-1}{(P-1)/2} \right) =1. \end{aligned}$$

Let \(P\equiv 13\) \((\mathrm{mod}16)\) and \(P\equiv 2\) \((\mathrm{mod}5).\) Then

$$\begin{aligned} (P-1)/4\equiv 4\,(\mathrm{mod}5)\text { and }(P-1)/4\equiv 3\,( \mathrm{mod}4) \end{aligned}$$

and therefore

$$\begin{aligned} \left( \dfrac{5}{(P-1)/4}\right) =1\text { and }\left( \dfrac{-1}{(P-1)/4} \right) =-1. \end{aligned}$$
(3.13)

Moreover,

$$\begin{aligned} 10x^{2}=-1+U_{n}=-1+U_{12t+4}\equiv -1+U_{4}\equiv P^{3}-2P-1\,(\mathrm{ mod}U_{3}) \end{aligned}$$

by (2.1). This implies that

$$\begin{aligned} 10x^{2}\equiv P^{3}-2P-1\,(\mathrm{mod}P-1). \end{aligned}$$

This shows that

$$\begin{aligned} 10x^{2}\equiv -2\,(\mathrm{mod}(P-1)/2) \end{aligned}$$

and therefore

$$\begin{aligned} 5x^{2}\equiv -1\,(\mathrm{mod}(P-1)/4), \end{aligned}$$

which is impossible by (3.13). Let \(P\equiv 13\) \((\mathrm{mod}16)\) and \( P\equiv 3\) \((\mathrm{mod}5).\) Since n is even, \(\ n=10q+r\) with \(r\in \{0,2,4,6,8\}.\) Since \(5|U_{5}\) by (2.7), we get \(10x^{2}+1=U_{n} \equiv U_{r}\) \((\mathrm{mod}5)\) by (2.1). A simple computation shows that \(r=4.\) Since \(n=10q+4\) and \(n=12t+4,\) we get \(\ n=60k+4\) for some natural number k. Thus, by using (2.2), it is seen that

$$\begin{aligned} U_{n}=U_{60k+4}\equiv U_{4}\,(\mathrm{mod}V_{5}), \end{aligned}$$

which implies that

$$\begin{aligned} 10x^{2}\equiv P^{3}-2P-1\,(\mathrm{mod}P^{4}-5P^{2}+5) \end{aligned}$$

since \(V_{5}=P(P^{4}-5P^{2}+5).\) This shows that

$$\begin{aligned} 5x^{2}\equiv (P^{3}-2P-1)/2\,(\mathrm{mod}P^{4}-5P^{2}+5) \end{aligned}$$

and therefore

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

Since \((P^{3}-2P-1)/2\equiv 5\) \((\mathrm{mod}8),\) \(P^{4}-5P^{2}+5\equiv 1\) \(( \mathrm{mod}5),\) \(P^{4}-5P^{2}+5\equiv 9\) \((\mathrm{mod}16),\) and \( -3P^{2}+P+5\equiv 7\) \((\mathrm{mod}16),\) we get

$$\begin{aligned} 1= & {} \left( \dfrac{P^{4}-5P^{2}+5}{5}\right) =\left( \dfrac{5}{P^{4}-5P^{2}+5 }\right) =\left( \dfrac{(P^{3}-2P-1)/2}{P^{4}-5P^{2}+5}\right) \\= & {} \left( \dfrac{P^{4}-5P^{2}+5}{(P^{3}-2P-1)/2}\right) =\left( \dfrac{ -3P^{2}+P+5}{(P^{3}-2P-1)/2}\right) =\left( \dfrac{(P^{3}-2P-1)/2}{ -3P^{2}+P+5}\right) \\= & {} \left( \dfrac{P^{3}-2P-1}{-3P^{2}+P+5}\right) \left( \dfrac{2}{-3P^{2}+P+5 }\right) =\left( \dfrac{P^{3}-2P-1}{-3P^{2}+P+5}\right) \\= & {} \left( \dfrac{9(P^{3}-2P-1)}{-3P^{2}+P+5}\right) =\left( \dfrac{-2(P+2)}{ -3P^{2}+P+5}\right) \\= & {} \left( \dfrac{-2}{-3P^{2}+P+5}\right) \left( \dfrac{P+2}{-3P^{2}+P+5} \right) \\= & {} -\left( \dfrac{P+2}{-3P^{2}+P+5}\right) =\left( \dfrac{-3P^{2}+P+5}{P+2} \right) =\left( \dfrac{-1}{P+2}\right) =-1, \end{aligned}$$

a contradiction. Now assume that \(n>1\) and n is odd. Then \(n=2m+1\) with \( m\ge 1.\) Therefore \(U_{2m+1}=10x^{2}+1,\) which implies that \( 10x^{2}=U_{2m+1}-1=U_{m}V_{m+1}\) by (2.9). Let m be odd. Then \( (U_{m},V_{m+1})=1\) by (2.13) and (2.8). Thus,

$$\begin{aligned} U_{m}= & {} a^{2}\text { and }V_{m+1}=10b^{2}, \end{aligned}$$
(3.14)
$$\begin{aligned} U_{m}= & {} 10a^{2}\text { and }V_{m+1}=b^{2}, \end{aligned}$$
(3.15)
$$\begin{aligned} U_{m}= & {} 2a^{2}\text { and }V_{m+1}=5b^{2}, \end{aligned}$$
(3.16)

or

$$\begin{aligned} U_{m}=5a^{2}\text { and }V_{m+1}=2b^{2} \end{aligned}$$
(3.17)

for some integers a and b. The identity (3.15) is impossible by Theorem 2.9. The identities (3.14) and (3.16) are impossible by (2.14), and (3.17) is impossible by Theorem . Let m be even. Then \((U_{m},V_{m+1})=P\) by (2.13). Thus,

$$\begin{aligned} U_{m}= & {} Pa^{2}\text { and }V_{m+1}=10Pb^{2}, \end{aligned}$$
(3.18)
$$\begin{aligned} U_{m}= & {} 10Pa^{2}\text { and }V_{m+1}=Pb^{2}, \end{aligned}$$
(3.19)
$$\begin{aligned} U_{m}= & {} 2Pa^{2}\text { and }V_{m+1}=5Pb^{2}, \end{aligned}$$
(3.20)

or

$$\begin{aligned} U_{m}=5Pa^{2}\text { and }V_{m+1}=2Pb^{2} \end{aligned}$$
(3.21)

for some integers a and b. The identities (3.18) and (3.20) are impossible by (2.14), and (3.19) is impossible by Theorem 2.3. Assume that (3.21) is satisfied. Then by Theorem 2.4, we get \(m=2\) and therefore \(n=5.\) Consequently, we have \(n=1,2,5\). But it can be seen that 5 is not a solution and therefore \(n=1,2.\) \(\square \)

By using MAGMA [25], it can be shown that the equation \( 2Px^{2}+1=U_{5}=P^{4}-3P^{2}+1\) has only the solution \(P=3.\) Therefore we can give the following corollary by using Theorem 3.1 and Lemmas 2.13 and 2.14.

Corollary 3.6

The equations \(x^{2}-(P^{2}-4)(2Py^{2}+1)^{2}=4\) and \( (2Px^{2}+1)^{2}-P(2Px^{2}+1)y+y^{2}=1\) have positive integer solutions only when \(P=3\). The solutions are given by \((x,y)=(123,3)\) and \((x,y)=(3,21),\) respectively.

Corollary 3.7

Let \(k=1,2,3,5,10.\) The equations \(x^{2}-(P^{2}-4)(ky^{2}+1)^{2}=4\) and \( (kx^{2}+1)^{2}-P(kx^{2}+1)y+y^{2}=1\) have positive integer solutions only when \(P=ka^{2}+1\) for some integer a.

Corollary 3.8

The equations \(x^{2}-(P^{2}-4)(6y^{2}+1)^{2}=4\) and \( (6x^{2}+1)^{2}-P(6x^{2}+1)y+y^{2}=1\) have positive integer solutions only when \(P=6a^{2}+1\) for some integer a or \(P=3(U_{m}(10,-1)+U_{m-1}(10,-1))\) for some \(m\ge 1\) and there is only one solution in each case.

Proof

In order to prove the corollary we must solve the equation \( 6x^{2}+1=U_{5}=P^{4}-3P^{2}+1.\) Since \(6x^{2}+1=P^{4}-3P^{2}+1,\) it is seen that \(P=3a\) and \(x=3b\) for some integers a and b. Then we get \( a^{2}(3a^{2}-1)=2b^{2},\) which implies that \(3a^{2}-1=2v^{2}.\) This shows that \(3a^{2}-2v^{2}=1.\) Thus, by Lemma 2.11, we get \(a=\) \( U_{m}(10,-1)-U_{m-1}(10,-1)\) for some \(m\ge 1.\) Since \(P=3a,\) the proof follows. \(\square \)

From Theorem 3.4 and Lemma 2.12, we can give the following corollary easily.

Corollary 3.9

The equations \(x^{2}-(P^{2}-4)(7y^{2}+1)^{2}=4\) and \( (7x^{2}+1)^{2}-P(7x^{2}+1)y+y^{2}=1\) have positive integer solutions only when \(P=7a^{2}+1\) for some integer a or \(P=3\left( U_{m+1}(16-1)-U_{m}(16,-1)\right) \) for some \(m\ge 1\) and there is only one solution in each case.