1 Introduction

For \(k\ge 2\), let \(\left( P^{(k)}_n\right) _{n\ge -(k-2)}\) denote the k-Pell sequence given by the recurrence

$$\begin{aligned} P_n^{(k)}=2P_{n-1}^{(k)}+P_{n-2}^{(k)}+\cdots +P_{n-k}^{(k)}\quad \text {for }n \ge 2, \end{aligned}$$
(1.1)

with the initial conditions \(P_{-(k-2)}^{(k)}=P_{-(k-3)}^{(k)}=\cdots = P_{0}^{(k)}=0\) and \(P_1^{(k)}=1\). If \(k=2\), we obtain the classical Pell sequence.

The problem of finding the Padovan number \({\mathcal {P}}_n\) and the Perrin number \(E_n\) in the Pell sequence was treated in [10] by the second and third authors. They showed that \({\mathcal {P}}\cap P=\{0, 1, 2, 5, 12\}\) and \(E\cap P = \{0, 2, 5, 12, 29\}\). The main objective of this work is to determine the Padovan and Perrin numbers in the k-Pell sequence. We prove the following results.

Theorem 1.1

All the solutions of the Diophantine equation

$$\begin{aligned} P_n ^{(k)} ={\mathcal {P}}_m \end{aligned}$$
(1.2)

in positive integers (mnk) with \(k\ge 3\) belong to

$$\begin{aligned} \{(1,1,k),(2,1,k),(3,1,k),(4,2,k),(5,2,k),(8,3,k)\}. \end{aligned}$$

Thus, we have \(P^{(k)}\cap {\mathcal {P}}=\{1,2,5\}\), for \(k\ge 3\).

Theorem 1.2

All the solutions of the Diophantine equation

$$\begin{aligned} P_n ^{(k)} =E_m \end{aligned}$$
(1.3)

in positive integers (mnk) with \(k\ge 3\) belong to

$$\begin{aligned} \{(2,2,k),(4,2,k),(5,3,k),(6,3,k)\}. \end{aligned}$$

Thus, we have \(P^{(k)}\cap E=\{2,5\}\), for \(k\ge 3\).

Our proof of Theorem 1.1 is mainly based on linear forms in logarithms of algebraic numbers and a reduction algorithm originally introduced by Baker and Davenport [1]. Here, we use a version due to Dujella and Pethő [5].

2 Tools

2.1 Linear forms in logarithms

For any non-zero algebraic number \(\eta \) of degree d over \({\mathbb {Q}}\), whose minimal polynomial over \({\mathbb {Z}}\) is \(a\prod _{j=1}^d \left( X-\eta ^{(j)} \right) \), we denote by

$$\begin{aligned} h(\eta ) = \frac{1}{d} \left( \log |a| + \sum _{j=1}^d \log \max \{1, |{\eta ^{(j)}}|\}\right) \end{aligned}$$

the usual absolute logarithmic height of \(\eta \). In particular, if \(\eta = p/q\) is a rational number with \(\gcd (p, q) = 1\) and \(q > 0\), then \(h(\eta ) = \log \max \{|p|, q\}\). The following properties of the logarithmic height h(), which will be used in subsequent sections without a special reference, are also well-known:

$$\begin{aligned} h(\eta \pm \gamma )\le & {} h(\eta )+ h(\gamma )+\log 2, \end{aligned}$$
(2.1)
$$\begin{aligned} h(\eta \gamma ^{\pm 1})\le & {} h(\eta ) + h(\gamma ), \end{aligned}$$
(2.2)
$$\begin{aligned} h(\eta ^s)= & {} \left| s\right| h(\eta )\quad (s\in {\mathbb {Z}}). \end{aligned}$$
(2.3)

With this notation, we recall Theorem 9.4 of [4], which is a modified version of a result of Matveev [8].

Theorem 2.1

Let \(\eta _1,\ldots ,\eta _s\) be nonzero real algebraic numbers and let \(b_1,\ldots ,b_s\) be integers. Let \(d_{{\mathbb {K}}}\) be the degree of the number field \({\mathbb {Q}}(\eta _1,\ldots ,\eta _s)\) over \({\mathbb {Q}}\) and let \(A_j\) be a positive real number satisfying

$$\begin{aligned} A_j\ge \max \{d_{{\mathbb {K}}}h(\eta _j),|\log \eta _j|,0.16\},\quad \text {for}\quad j=1,\ldots ,s. \end{aligned}$$

Assume that

$$\begin{aligned} B=\max \{|b_1|,\ldots ,|b_s|\}. \end{aligned}$$

If \(\eta _1^{b_1}\cdots \eta _s^{b_s}-1\ne 0\), then

$$\begin{aligned} |\eta _1^{b_1}\cdots \eta _s^{b_s}-1|\ge \exp (-1.4\cdot 30^{s+3}\cdot s^{4.5}\cdot d_{{\mathbb {K}}}^2(1+\log d_{{\mathbb {K}}})(1+\log B) A_1\cdots A_s). \end{aligned}$$

2.2 Reduction algorithm

Here, we present the following result due to Dujella and Pethő, which is a generalization of a result of Baker and Davenport (see [5]).

Lemma 2.2

Suppose that M is a positive integer. Let p/q be the convergent of the continued fraction expansion of \(\gamma \) such that \(q > 6M\) and let

$$\begin{aligned} \varepsilon =||\mu q||-M\cdot ||\gamma q||, \end{aligned}$$

where \(||\cdot ||\) denotes the distance from the nearest integer. If \(\varepsilon >0\), then there is no solution of the inequality

$$\begin{aligned} 0< \left| u \gamma - v + \mu \right| <A B^{-u} \end{aligned}$$

in positive integers uv with

$$\begin{aligned} \dfrac{\log (Aq/\varepsilon )}{\log B} \le u\le M. \end{aligned}$$

2.3 Properties of Padovan and Perrin sequences

Let \(({\mathcal {P}}_m)_{m\ge 0}\) be the Padovan sequence (sequence A000931 in the OEIS [11]) given by

$$\begin{aligned} {\mathcal {P}}_{m+3}={\mathcal {P}}_{m+1} + {\mathcal {P}}_m, \end{aligned}$$

for \(m\ge 0\), where \({\mathcal {P}}_0={\mathcal {P}}_1 = {\mathcal {P}}_2=1\). The first few terms of this sequence are

$$\begin{aligned} 1, 1, 1, 2, 2, 3, 4, 5, 7, 9, 12, 16, 21, 28, 37, 49, 65, 86, 114, 151, 200, \ldots \end{aligned}$$

Similarly, let \((E_m)_{m\ge 0}\) be the Perrin sequence (sequence A001608 [11]) given by

$$\begin{aligned} E_{m+3}=E_{m+1} + E_m, \end{aligned}$$

for \(m\ge 0\), where \(E_0=3, E_1 = 0\) and \(E_2 = 2\). The first few terms of this sequence are

$$\begin{aligned} 3, 0, 2, 3, 2, 5, 5, 7, 10, 12, 17, 22, 29, 39, 51, 68, 90, 119, 158, 209, 277, \ldots \end{aligned}$$

The characteristic equation

$$\begin{aligned} x^3-x-1=0 \end{aligned}$$

has roots \(\alpha , \beta \) and \({\overline{\beta }}\), where

$$\begin{aligned} \alpha =\dfrac{r_1+r_2}{6},\quad \beta =\dfrac{-r_1-r_2+i\sqrt{3}(r_1-r_2)}{12}, \end{aligned}$$

with

$$\begin{aligned} r_1=\root 3 \of {108+12\sqrt{69}}\;\text { and }\; r_2=\root 3 \of {108-12\sqrt{69}}. \end{aligned}$$

Furthermore, the Binet’s formula for \({\mathcal {P}}_n\) is

$$\begin{aligned} {\mathcal {P}}_n= c_\alpha \alpha ^n+c_\beta \beta ^n + c_{{\overline{\beta }}} {\overline{\beta }}^n, \quad {{\text {for }}}\quad n\ge 0, \end{aligned}$$
(2.4)

and the Binet’s formula for \(E_n\) is

$$\begin{aligned} E_n = \alpha ^n + \beta ^n + {\overline{\beta }}^n, \quad {{\text {for }}}\quad n\ge 0, \end{aligned}$$
(2.5)

where

$$\begin{aligned} \begin{array}{lllll} c_{\alpha } &{}=&{} \dfrac{(1-\beta )(1-{\overline{\beta }})}{(\alpha -\beta )(\alpha -{\overline{\beta }})} &{}=&{} \dfrac{1+\alpha }{-\alpha ^2+3\alpha +1},\\ c_{\beta } &{}=&{} \dfrac{(1-\alpha )(1-{\overline{\beta }})}{(\beta -\alpha )(\beta -{\overline{\beta }})} &{}=&{} \dfrac{1+\beta }{-\beta ^2+3\beta +1},\\ c_{{\overline{\beta }}} &{}=&{} \dfrac{(1-\alpha )(1-\beta )}{({\overline{\beta }}-\alpha )({\overline{\beta }}-\beta )} &{}=&{} \dfrac{1+{\overline{\beta }}}{-{\overline{\beta }}^2+3{\overline{\beta }}+1}=\overline{c_{\beta }}. \end{array} \end{aligned}$$
(2.6)

Numerically, we have

$$\begin{aligned} \begin{array}{l} 1.32<\alpha<1.33,\\ 0.86<|\beta |=|{\overline{\beta }}|<0.87,\\ 0.72<c_{\alpha }<0.73,\\ 0.24<|c_{\beta }|=|c_{{\overline{\beta }}}|<0.25. \end{array} \end{aligned}$$
(2.7)

It is easy to check that

$$\begin{aligned} |\beta |=|{\overline{\beta }}|=\alpha ^{-1/2}. \end{aligned}$$

Furthermore, using induction, one can prove that

$$\begin{aligned} \alpha ^{n-3}\le {\mathcal {P}}_n\le \alpha ^{n-1} \end{aligned}$$
(2.8)

and

$$\begin{aligned} \alpha ^{n-2}\le E_n\le \alpha ^{n+1}, \end{aligned}$$
(2.9)

for \(n\ge 2\).

2.4 Properties of k-generalized Pell sequence

In this subsection, we recall some facts and properties of this sequence which will be used later.

The characteristic polynomial of this sequence is

$$\begin{aligned} \Psi _k(x)=x^k-2x^{k-1}-\cdots - x-1. \end{aligned}$$

Bravo et al. [3] proved that \(\Psi _k(x)\) is irreducible over \({\mathbb {Q}}[x]\) and has just one root \(\gamma (k)\) outside the unit circle. It is real and positive so it satisfies \(\gamma (k)>1\). The other roots are strictly inside the unit circle. Furthermore, in the same paper they showed that

$$\begin{aligned} \varphi ^2(1-\varphi ^{-k})<\gamma (k)<\varphi ^2, \quad \text {for } k\ge 2, \end{aligned}$$
(2.10)

where \(\varphi =\frac{1+\sqrt{5}}{2}\). To simplify the notation, in general, we omit the dependence of \(\gamma \) on k and write \(\gamma (k)=\gamma \). For \(k\ge 2\), let

$$\begin{aligned} g_k(x):=\dfrac{x-1}{(k+1)x^2-3kx+k-1}=\dfrac{x-1}{k(x^2-3x+1)+x^2-1}. \end{aligned}$$
(2.11)

Bravo and Hererra [2] proved that

$$\begin{aligned} 0.276<g_k(\gamma )<0.5 \quad \text {and} \quad \left| g_k(\gamma ^{(i)})\right| <1, \;\; 2\le i\le k, \end{aligned}$$

where \(\gamma =\gamma ^{(1)},\ldots , \gamma ^{(k)}\) are all the zeros of \(\Psi _k(x)\). So, the number \(g_k(\gamma )\) is not an algebraic integer. In addition, they proved that the logarithmic height of \(g_k(\gamma )\) satisfies

$$\begin{aligned} h(g_k(\gamma ))<4k\log \varphi +k\log (k+1),\quad \text {for } k\ge 2. \end{aligned}$$
(2.12)

With the above notations, Bravo et al. [3] showed that

$$\begin{aligned} P_n^{(k)}=\sum _{i=1}^k g_k(\gamma ^{(i)}){\gamma ^{(i)}}^{n}\quad \text {and}\quad \left| P_n^{(k)} - g_k(\gamma )\gamma ^{n}\right| <\dfrac{1}{2}, \end{aligned}$$
(2.13)

for \(n \ge 1\) and \(k \ge 2\). So, for \(n\ge 1\) and \(k\ge 2\), we have

$$\begin{aligned} P_n^{(k)}=g_k(\gamma )\gamma ^{n}+e_k(n),\quad \text {where}\quad \left| e_k(n)\right| \le \dfrac{1}{2}. \end{aligned}$$
(2.14)

Furthermore, for \( n\ge 1\) and \(k\ge 2\), it was shown in [3] that

$$\begin{aligned} \gamma ^{n-2}\le P_n^{(k)} \le \gamma ^{n-1}. \end{aligned}$$
(2.15)

We conclude this subsection by giving the following estimate (see [2]). If \(k\ge 30\) and \(n>1\) are integers satisfying \(n<\varphi ^{k/2}\), then

$$\begin{aligned} g_k(\gamma )\gamma ^n=\dfrac{\varphi ^{2n}}{\varphi +2}(1+\zeta ),\quad \text {where}\quad \left| \zeta \right| <\dfrac{4}{\varphi ^{k/2}},\quad \varphi =\frac{1+\sqrt{5}}{2}. \end{aligned}$$
(2.16)

3 k-Pell numbers which are Padovan numbers

In this section, we will show Theorem 1.1. The proof of Theorem 1.1 will be done in four steps.

3.1 Setup

In this step, we study the Diophantine equation (1.2), for \(1\le n\le k+1\). Moreover, we will give an elementary relation between n and m, for \(n\ge k+2\). It is known that for \(1\le n \le k+1\), we have

$$\begin{aligned} P_n^{(k)}=F_{2n-1}, \end{aligned}$$

see [7]. De Weger [12] proved that all integers which are both Fibonacci and Padovan numbers are \(F_1=F_2=1\), \(F_3=2\), \(F_4=3\), \(F_5=5\), and \(F_8=21\). Thus, we deduce that the solutions of (1.2) in this range are \(P_1^{(k)}=1={\mathcal {P}}_1={\mathcal {P}}_2={\mathcal {P}}_3\), \(P_2^{(k)}=2={\mathcal {P}}_4={\mathcal {P}}_5\) and \(P_3^{(k)}=5={\mathcal {P}}_8\), for \(k\ge 3\).

From now on, we assume that \(n\ge k+2\). It remains to show that the Diophantine equation (1.2) has no solution in this range.

Let us now get a relation between n and m. Combining the inequalities (2.8) and (2.15) together with Eq. (1.2), we have

$$\begin{aligned} \gamma ^{n-2} \le \alpha ^{m-1}\quad \text {and}\quad \alpha ^{m-3} \le \gamma ^{n-1}. \end{aligned}$$

This means that

$$\begin{aligned} (n-2)\left( \dfrac{\log \gamma }{\log \alpha }\right) +1\le m \le (n-1) \left( \dfrac{\log \gamma }{\log \alpha }\right) +3. \end{aligned}$$

By the fact that \(\varphi ^2(1-\varphi ^{-3})< \gamma < \varphi ^2\), for \(k\ge 3\), it follows that

$$\begin{aligned} 2.4n-4<m<3.5n-0.4. \end{aligned}$$
(3.1)

3.2 Bounding n in terms of m and k

In this step, we will bound n in terms of m and k. Namely, we will show the following lemma.

Lemma 3.1

If (mnk) is a solution in positive integers of Eq. (1.2) with \(k\ge 3\) and \(n\ge k+2\), then we have the following inequalities

$$\begin{aligned} 0.28m<n<8 \times 10^{15} k^5 \log ^3 k. \end{aligned}$$
(3.2)

Proof

We use identities (2.4) and (2.14) to express (1.2) into the form

$$\begin{aligned} g_k(\gamma )\gamma ^{n}+e_k(n)=c_{\alpha }\alpha ^m+c_{\beta }\beta ^m+c_{{\overline{\beta }}}{\overline{\beta }}^m, \end{aligned}$$

which we rewrite as

$$\begin{aligned} \left| g_k(\gamma )\gamma ^{n}-c_{\alpha }\alpha ^m\right|<\dfrac{1}{2}+2\left| c_{\beta }\right| \left| \beta \right| ^m<1, \end{aligned}$$
(3.3)

where we have used (2.7) and (2.14). Dividing through by \(c_{\alpha }\alpha ^m\), we get

$$\begin{aligned} \left| \Lambda _1\right| <1.4\cdot \alpha ^{-m},\quad \text {where}\quad \Lambda _1:=(c_{\alpha }^{-1} g_k(\gamma )) \cdot \gamma ^{n} \cdot \alpha ^{-m} -1. \end{aligned}$$
(3.4)

To apply Theorem 2.1, we need to show that \(\Lambda _1\ne 0\). Indeed, \(\Lambda _1=0\) implies

$$\begin{aligned} g_k(\gamma )=c_{\alpha }\alpha ^m\gamma ^{-n}. \end{aligned}$$

Hence, \(g_k(\gamma )\) is an algebraic integer, which is false. Thus, \(\Lambda _1\ne 0\). To apply Theorem 2.1, we set

$$\begin{aligned} (\eta _1,b_1):=(c_{\alpha }^{-1} g_k(\gamma ),1), \quad (\eta _2,b_2):=(\gamma ,n), \quad \text {and}\quad (\eta _3,b_3):=(\alpha ,-m). \end{aligned}$$

One can see that \(\eta _1, \eta _2, \eta _3\in {\mathbb {K}}:={\mathbb {Q}}(\gamma ,\alpha )\) and \(d_{{\mathbb {K}}}\le 3k\). The fact that \(h(\eta _2)=(\log \gamma )/k<(2\log \varphi )/k\) and \(h(\eta _3)=(\log \alpha )/3\) gives

$$\begin{aligned} A_2:=6\log \varphi \ge \max \{3kh(\eta _2),\left| \log \eta _2\right| , 0.16\} \end{aligned}$$

and

$$\begin{aligned} A_3:=k\log \alpha \ge \max \{3kh(\eta _3),\left| \log \eta _3\right| , 0.16\}. \end{aligned}$$

On the other hand, the minimal polynomial of \(c_{\alpha }\) is

$$\begin{aligned} 23x^3-23x^2-6x-1, \end{aligned}$$

which has roots \(c_{\alpha }\), \(c_{\beta }\) and \(c_{{\overline{\beta }}}\). Since \(c_{\alpha }<1\) and \(\left| c_{\beta }\right| =\left| c_{{\overline{\beta }}}\right| <1\), then we get

$$\begin{aligned} h(c_{\alpha })=\dfrac{\log 23}{3}. \end{aligned}$$

Using the properties of the logarithmic height and the estimate (2.12), for \(k\ge 3\) we conclude that

$$\begin{aligned} h(\eta _1) \le h(c_{\alpha })+h(g_k(\gamma ))< \dfrac{\log 23}{3} +4k\log \varphi + k \log (k+1)<3.4k \log k. \end{aligned}$$

So, it follows that

$$\begin{aligned} A_1:=10.2k^2\log k \ge \max \{3kh(\eta _1),\left| \log \eta _1\right| , 0.16\} . \end{aligned}$$

Lastly, from (3.1), we can choose \(B\ge 3.5n>m=\max \{n,m\}\). Therefore, applying Theorem 2.1 on \(|\Lambda _1|\) and using inequality (3.4), we obtain

$$\begin{aligned} m\log \alpha -\log 1.4<1.07 \times 10^{13}k^5\log k (1+\log 3k) (1+\log 3.5n). \end{aligned}$$

The above inequality and the facts \(1+\log 3k<3\log k\) and \(1+\log 3.5n<2.4\log n\), for \(k\ge 3\) and \(n\ge 5\), give

$$\begin{aligned} m< 2.74\times 10^{14} k^5 \log ^2 k \log n. \end{aligned}$$

Using inequalities (3.1), the last inequality turns into

$$\begin{aligned} \dfrac{n}{\log n}<1.15\times 10^{14} k^5 \log ^2 k. \end{aligned}$$
(3.5)

Since the function \(x\mapsto x/\log x\) is increasing for \(x>e\), it is easy to check that the inequality

$$\begin{aligned} \dfrac{x}{\log x}<A \quad \text { implies} \quad x<2A\log A \text { whenever } A\ge 3. \end{aligned}$$
(3.6)

So, if we put \(A:=1.15\times 10^{14} k^5 \log ^2 k\) in (3.6), then (3.5) together with \(32.4+5\log k+2\log \log k<34.7\log k\), which holds for \(k\ge 3\), imply

$$\begin{aligned} \begin{array}{rcl} n &{}< &{} 2(1.15\times 10^{14} k^5 \log ^2 k) \log (1.15\times 10^{14} k^5 \log ^2 k)\\ &{}< &{} (2.3\times 10^{14} k^5 \log ^2 k)(32.4+5\log k+2\log \log k)\\ &{} < &{} 8 \times 10^{15} k^5 \log ^3 k. \end{array} \end{aligned}$$

Therefore, we have finished the proof of Lemma 3.1. \(\square \)

3.3 The case \(3\le k\le 350\)

In this subsection, we treat the case when \(k\in [3,350]\) using Lemma 2.2. We will prove the following result.

Lemma 3.2

The Diophantine equation (1.2) has no solution when \(k\in [3,350]\) and \(n\ge k+2\).

Proof

To apply Lemma 2.2, we define

$$\begin{aligned} \Gamma _1:=n\log \gamma -m\log \alpha + \log (c_{\alpha }^{-1}g_k(\gamma ))=\log (\Lambda _1+1). \end{aligned}$$
(3.7)

Thus, inequality (3.4) can be rewritten as

$$\begin{aligned} \left| e^{\Gamma _1}-1\right| <1.4\cdot \alpha ^{-m}. \end{aligned}$$
(3.8)

Note that \(\Gamma _1\ne 0\) since \(\Lambda _1\ne 0\). So, we distinguish the following cases. If \(\Gamma _1>0\), then \(e^{\Gamma _1}-1>0\). Using the fact that \(x\le e^x-1\), for \(x\in {\mathbb {R}}\), and from (3.8) we obtain

$$\begin{aligned} 0<\Gamma _1<1.4\cdot \alpha ^{-m}. \end{aligned}$$

Now, suppose that \(\Gamma _1 < 0\). It is easy to see that \(1.4\cdot \alpha ^{-m} < 1/2\), for \(m \ge 9\). Thus, from (3.8), we have \(\left| e^{\Gamma _1}-1\right| <1/2\) and therefore \(e^{\left| \Gamma _1\right| }<2\). Since \(\Gamma _1<0\), we obtain

$$\begin{aligned} 0<\left| \Gamma _1\right| \le e^{\left| \Gamma _1\right| }-1=e^{\left| \Gamma _1\right| }\left| e^{\Gamma _1}-1\right| <2.8\cdot \alpha ^{-m}. \end{aligned}$$

Therefore, in both cases we have

$$\begin{aligned} 0<\left| \Gamma _1\right| <2.8\cdot \alpha ^{-m}. \end{aligned}$$
(3.9)

Inserting (3.7) in (3.9) and dividing across by \(\log \alpha \), it results that

$$\begin{aligned} \left| n\left( \dfrac{\log \gamma }{\log \alpha }\right) -m+\dfrac{\log (c_{\alpha }^{-1}g_k(\gamma ))}{\log \alpha }\right|<\dfrac{2.8}{\log \alpha }\cdot \alpha ^{-m}< 10\cdot \alpha ^{-m}. \end{aligned}$$
(3.10)

To apply Lemma 2.2, we set

$$\begin{aligned} {\widehat{\gamma }}:= \dfrac{\log \gamma }{\log \alpha }, \quad \mu :=\dfrac{\log (c_{\alpha }^{-1} g_k(\gamma ))}{\log \alpha },\quad w:=m, \quad A:=10,\quad \text {and}\quad B:=\alpha . \end{aligned}$$

We have \({\widehat{\gamma }}\not \in {\mathbb {Q}}\). Indeed, if we assume there exist coprime integers a and b such that \({\widehat{\gamma }}=a/b\), then we get that \(\alpha ^a=\gamma ^b\). Let \(\sigma \in Gal({\mathbb {K}}/{\mathbb {Q}})\) such that \(\sigma (\gamma ) =\gamma \) and \(\sigma (\gamma ) =\gamma _i \), for some \(i\in \{2,\ldots , k\}\). Applying this to the above relation and taking absolute values we get \(1<\gamma ^a=\left| \gamma _i\right| <1\), which is a contradiction.

For each \(k\in [3,350]\), using Theorem 15 of [6], we find a good approximation of \({\widehat{\gamma }}\) as a convergent \(p_\ell /q_\ell \) of the continued fraction of \({\widehat{\gamma }}\) such that \(q_\ell >6M_k\) and \(\varepsilon =\varepsilon (k)=||\mu q_\ell ||-M_k || {\widehat{\gamma }}q_\ell ||>0\), where \(M_k=\lfloor 2.8 \times 10^{16} k^5 \log ^3 k\rfloor \), which is an upper bound of \(n-1\) from Lemma 3.1. After doing this, we use Lemma 2.2 on inequality (3.10). A computer program with Mathematica revealed that the maximum value of \(\dfrac{\log (Aq_\ell /\varepsilon )}{\log B}\) over all \(k\in [3,350]\) is \(292.327590\cdots \), which according to Lemma 2.2 is an upper bound for m. Hence, we deduce that the possible solutions (mnk) of Eq. (1.2) for which \(k\in [3,350]\) have \(m\le 292\), therefore \(n\le 83\).

Finally, we use a Mathematica program to compare \(P_n^{(k)}\) and \({\mathcal {P}}_m\) for \(5 \le n \le 83\) and \(8 \le m \le 292\), with \(m <n/0.28\) and see that Eq. (1.2) has no other solution. \(\square \)

3.4 The case \(k>350\)

In this subsection, we treat the case \(k> 350\) by proving the following result.

Lemma 3.3

The Diophantine equation (1.2) has no solution when \(k> 350\) and \(n\ge k+2\).

Proof

For \(k>350\), we have

$$\begin{aligned} 0.28m<n<8 \times 10^{15} k^5 \log ^3 k<\varphi ^{k/2}. \end{aligned}$$

So, from (3.3) and (2.16), we obtain

$$\begin{aligned} \left| \dfrac{\varphi ^{2n}}{\varphi +2}-c_{\alpha }\alpha ^m\right|<\left| g_k(\gamma )\gamma ^n-c_{\alpha }\alpha ^m\right| +\dfrac{\varphi ^{2n}\left| \zeta \right| }{\varphi +2}< \dfrac{4\varphi ^{2n}}{(\varphi +2)\varphi ^{k/2}}+ 1. \end{aligned}$$

As \(n\ge k+2\), this and the fact \(1/\varphi ^{2n}<1/\varphi ^{k/2}\) yield

$$\begin{aligned} \left| \Lambda _2\right| < \dfrac{7.7}{\varphi ^{k/2}},\quad \text {where}\quad \Lambda _2:=c_{\alpha }(\varphi +2)\cdot \varphi ^{-2n}\cdot \alpha ^m-1. \end{aligned}$$
(3.11)

But \(\Lambda _2\) is not zero. Indeed, if \(\Lambda _2\) were zero, we would then get that \(\varphi ^{2n}/(\varphi +2)=c_{\alpha }\alpha ^{m}\). Using the \({\mathbb {Q}}\)-automorphism \((\alpha \beta )\) of the Galois extension \({\mathbb {Q}}(\varphi ,\alpha , \beta )\) over \({\mathbb {Q}}\) we get \(33<\varphi ^{2n}/(\varphi +2)=\left| c_{\beta }\right| \left| \beta \right| ^m<1\), which is impossible. Therefore, we can apply Theorem 2.1 with

$$\begin{aligned} s:=3,\quad (\eta _1,b_1):=(c_{\alpha }(\varphi +2),1), \quad (\eta _2,b_2):=(\varphi ,-2n), \quad \text {and}\quad (\eta _3,b_3):=(\alpha ,m). \end{aligned}$$

We have \(\eta _1, \eta _2, \eta _3\in {\mathbb {K}}:={\mathbb {Q}}(\varphi ,\alpha )\) and \(d_{{\mathbb {K}}}= 6\). The fact that \(m\le 3.5n\), for \(n\ge 5\), implies that we can choose \(B:=3.5n\). On the other hand, since

$$\begin{aligned} h(\eta _2)=\dfrac{\log \varphi }{2}, \quad h(\eta _3)=\dfrac{\log \alpha }{3}, \end{aligned}$$

and

$$\begin{aligned} h(\eta _1)\le h(c_{\alpha })+h(\varphi )+h(2)+\log 2\le \dfrac{\log 23}{3}+\dfrac{\log \varphi }{2}+2\log 2 <2.68, \end{aligned}$$

using the original expressions of \(\varphi , \alpha \), we can take

$$\begin{aligned}{} & {} A_1:=16.08> \max \{6h(\eta _1),\left| \log \eta _1\right| , 0.16\} ,\\{} & {} A_2:=1.45 > \max \{6h(\eta _2),\left| \log \eta _2\right| , 0.16\}, \end{aligned}$$

and

$$\begin{aligned} A_3:=0.58 >\max \{6h(\eta _3),\left| \log \eta _3\right| , 0.16\}. \end{aligned}$$

From Theorem 2.1, we get

$$\begin{aligned} \left| \Lambda _2\right| > \exp \left( -4.6\times 10^{14} \log n\right) , \end{aligned}$$
(3.12)

where we have used the fact that \(1+\log (3.5n)<2.4\log n \), for \(n\ge 5\). Putting (3.11) and (3.12) together, we obtain

$$\begin{aligned} k<1.92\times 10^{15}\log n. \end{aligned}$$

By Lemma 3.1 and using the fact that \(36.7+5\log k +3\log \log k<12.3\log k\) for \(k>350\), we get

$$\begin{aligned} \begin{array}{rcl} k&{}<&{}1.92\times 10^{15}\log (8\times 10^{15} k^5\log ^3k)\\ &{}<&{} 1.92\times 10^{15}(36.7+5\log k +3\log \log k)\\ &{}<&{} 2.37 \times 10^{16} \log k. \end{array} \end{aligned}$$

Solving the above inequality gives

$$\begin{aligned} k<9.82\times 10^{17}, \end{aligned}$$

and from Lemma 3.1 once again, we deduce that

$$\begin{aligned} \begin{array}{rcl} n&{}<&{}8\cdot 10^{15}(9.82\cdot 10^{17})^{15}(\log (9.82\cdot 10^{17}))^3<5.2 \times 10^{110}\\ m&{}<&{}3.5n<3.5\times 5.2\times 10^{110}=1.82 \times 10^{111}. \end{array} \end{aligned}$$
(3.13)

Define

$$\begin{aligned} \Gamma _2:=m\log \alpha -2n\log \varphi +\log (c_{\alpha }(\varphi +2))=\log (\Lambda _2+1). \end{aligned}$$

By a similar method used to prove inequality (3.9), we see that

$$\begin{aligned} 0<\left| \Gamma _2\right| < \dfrac{15.4}{\varphi ^{k/2}}, \end{aligned}$$
(3.14)

for \(k>350\). Replacing \(\Gamma _2\) in the above inequality and dividing across by \(\log \varphi \), one gets

$$\begin{aligned} 0<\left| m \left( \dfrac{\log \alpha }{\log \varphi }\right) -2n + \dfrac{\log (c_{\alpha }(\varphi +2))}{\log \varphi }\right| <32.1\cdot \varphi ^{-k/2}. \end{aligned}$$
(3.15)

With the goal to apply Lemma 2.2, we put

$$\begin{aligned} {\widehat{\gamma }}:=\dfrac{\log \alpha }{\log \varphi }, \quad \mu := \dfrac{\log (c_{\alpha }(\varphi +2))}{\log \varphi }, \quad A:=32.1 \quad \text {and}\quad B:=\varphi . \end{aligned}$$

The bounds (3.13) enable us to take \(M:=1.82 \times 10^{111}\). Using Maple, we find that \(q_{231}\) satisfying the hypotheses of Lemma 2.2, and we get

$$\begin{aligned} \dfrac{k}{2}< 550. \end{aligned}$$
(3.16)

With this new upper bound for k, we obtain

$$\begin{aligned} n<4.43\times 10^{33} \quad \text {and} \quad m< 1.56\times 10^{34}. \end{aligned}$$

We apply again Lemma 2.2 with \(M:=1.56\times 10^{34}\) and \(q=q_{65}\) in this time, we get \(k< 356\). Hence, we deduce

$$\begin{aligned} n<9.3\times 10^{30} \quad \text {and} \quad m< 3.26\times 10^{31}. \end{aligned}$$

We apply Lemma 2.2 for the third time but with \(M:=3.26\times 10^{31}\) and \(q=q_{60}\). In this application, we get \(k< 330\), which contradicts our assumption that \(k>350\). Hence, we have shown that there are no solutions (nkm) to Eq. (1.2) with \(k>350\). \(\square \)

All these steps complete the proof of Theorem 1.1.

4 k-Pell numbers which are Perrin numbers

In this section, we will show Theorem 1.2. The proof of Theorem 1.2 is similar to that of Theorem 1.1 and will be done also in four steps. For the sake of completeness, we will give most of the details.

4.1 Setup

In this step, we will study the Diophantine equation (1.3) for \(1\le n\le k+1\) and we will give an elementary relation between n and m for \(n\ge k+2\).

It is known that for \(1\le n \le k+1\), we have

$$\begin{aligned} P_n^{(k)}=F_{2n-1}. \end{aligned}$$

In [9], the authors showed that \(E\cap F=\{2,3,5\}\). Hence, we conclude that the solutions of (1.3) in this range are \(P_2^{(k)}=2=E_2=E_4\), and \(P_3^{(k)}=5=E_5=E_6\), for \(k\ge 3\).

From now on, we assume that \(n\ge k+2\). We will show that Diophantine equation (1.3) has no solution in this range.

Combining inequalities (2.15) and (2.9) with Eq. (1.3), one obtains

$$\begin{aligned} \gamma ^{n-2} \le \alpha ^{m+1}\quad \text {and}\quad \alpha ^{m-3} \le \gamma ^{n-1}, \end{aligned}$$

i.e.

$$\begin{aligned} (n-2)\left( \dfrac{\log \gamma }{\log \alpha }\right) -1\le m \le (n-1) \left( \dfrac{\log \gamma }{\log \alpha }\right) +3. \end{aligned}$$

This and the fact that \(\varphi ^2(1-\varphi ^{-3})< \gamma < \varphi ^2\), for \(k\ge 2\), give

$$\begin{aligned} 2.4n-5.9<m<3.5n-0.4. \end{aligned}$$
(4.1)

4.2 An inequality for n in terms of m and k

In this step, we prove the following lemma.

Lemma 4.1

If (mnk) is a solution in integers of Eq. (1.3) with \(k\ge 3\) and \(n\ge k+2\) then the inequalities

$$\begin{aligned} 0.28m<n< 7.3 \times 10^{15} k^5 \log ^3 k \end{aligned}$$
(4.2)

hold.

Proof

Using identities (2.5) and (2.14), we express (1.3) into the form

$$\begin{aligned} g_k(\gamma )\gamma ^{n}+e_k(n)=\alpha ^m+\beta ^m+{\overline{\beta }}^m, \end{aligned}$$

which gives

$$\begin{aligned} \left| g_k(\gamma )\gamma ^{n}-\alpha ^m\right| <2.3. \end{aligned}$$
(4.3)

We deduce that

$$\begin{aligned} \left| \Lambda _3\right| <2.3\cdot \alpha ^{-m}, \quad \text {where}\quad \Lambda _3:=g_k(\gamma ) \cdot \gamma ^{n} \cdot \alpha ^{-m} -1 . \end{aligned}$$
(4.4)

To establish (4.2), we will apply Theorem 2.1 with the following parameters

$$\begin{aligned} s:=3,\quad (\eta _1,b_1):=(g_k(\gamma ),1), \quad (\eta _2,b_2):=(\gamma ,n), \quad \text {and}\quad (\eta _3,b_3):=(\alpha ,-m). \end{aligned}$$

The field \({\mathbb {K}}:={\mathbb {Q}}(\gamma ,\alpha )\) contains \(\eta _1, \eta _2, \eta _3\) and \(d_{{\mathbb {K}}}\le 3k\). Since

$$\begin{aligned} h(\eta _1)<3.1k\log k ,\quad h(\eta _2)=(\log \gamma )/k<(2\log \varphi )/k \quad h(\eta _3)=(\log \alpha )/3, \end{aligned}$$

it follows that

$$\begin{aligned}{} & {} \max \{3kh(\eta _1),\left| \log \eta _1\right| , 0.16\} \le 9.3k^2\log k :=A_1,\\{} & {} \max \{3kh(\eta _2),\left| \log \eta _2\right| , 0.16\} \le 6\log \varphi :=A_2 \end{aligned}$$

and

$$\begin{aligned} \max \{3kh(\eta _3),\left| \log \eta _3\right| , 0.16\} \le k\log \alpha :=A_3. \end{aligned}$$

In addition, we can take \(B:=3.5n\) (see (4.1)). Before applying Theorem 2.1, we need to show that \(\Lambda _3\ne 0\). Suppose the contrary, i.e. \(\Lambda _3=0\). This implies that

$$\begin{aligned} g_k(\gamma )=\alpha ^{m}\gamma ^{-n}. \end{aligned}$$

Hence, \(g_k(\gamma )\) is an algebraic integer, which is false. Thus, \(\Lambda _3\ne 0\). Therefore, we apply Theorem 2.1 to get a lower bound for \(|\Lambda _3|\) and compare this with inequality (4.4). It follows that

$$\begin{aligned} m\log \alpha -\log 2.3< 9.74 \times 10^{12}k^5\log k (1+\log 3k) (1+\log 3.5n). \end{aligned}$$

Taking into account the facts \(1+\log 3k<3\log k\) and \(1+\log 3.5n<2.4\log n\), which hold for \(k\ge 3\) and \(n\ge 5\), we get

$$\begin{aligned} m<2.5\times 10^{14} k^5 \log ^2 k \log n. \end{aligned}$$

The above inequality and (4.1) lead to

$$\begin{aligned} \dfrac{n}{\log n}< 1.05\times 10^{14} k^5 \log ^2 k. \end{aligned}$$
(4.5)

So, if we put \(A:=1.05\times 10^{14} k^5 \log ^2 k\) in (3.6), then (4.5) together with \(32.3+5\log k+2\log \log k<34.6\log k\), which holds for \(k\ge 3\), imply

$$\begin{aligned} \begin{array}{rcl} n &{}< &{} 2(1.05\times 10^{14} k^5 \log ^2 k) \log (1.05\times 10^{14} k^5 \log ^2 k)\\ &{}< &{} (2.1\times 10^{14} k^5 \log ^2 k)(32.3+5\log k+2\log \log k)\\ &{} < &{} 7.3 \times 10^{15} k^5 \log ^3 k. \end{array} \end{aligned}$$

Therefore, we have finished the proof of the lemma. \(\square \)

4.3 The case \(3\le k\le 380\)

In this step, we study the case when \(k\in [3,380]\). We prove the following lemma.

Lemma 4.2

The Diophantine equation (1.3) has no solution when \(k\in [3,380]\) and \(n\ge k+2\).

Proof

Let

$$\begin{aligned} \Gamma _3:=n\log \gamma -m\log \alpha + \log (g_k(\gamma ))=\log (\Lambda _3+1). \end{aligned}$$
(4.6)

Hence, (4.4) can be rewritten as

$$\begin{aligned} \left| e^{\Gamma _3}-1\right| <2.3\cdot \alpha ^{-m}. \end{aligned}$$
(4.7)

Using the method employed to obtain (3.9), we get

$$\begin{aligned} 0<\left| \Gamma _3\right| <4.6\alpha ^{-m}. \end{aligned}$$
(4.8)

Inserting (4.6) in (4.8) and dividing across by \(\log \alpha \), we have

$$\begin{aligned} \left| n\left( \dfrac{\log \gamma }{\log \alpha }\right) -m+\dfrac{\log (g_k(\gamma ))}{\log \alpha }\right|<\dfrac{4.6}{\log \alpha }\cdot \alpha ^{-m}< 16.4\cdot \alpha ^{-m}. \end{aligned}$$
(4.9)

In order to apply Lemma 2.2 on \(\Gamma _3\), we set

$$\begin{aligned} {\widehat{\gamma }}:= \dfrac{\log \gamma }{\log \alpha }, \quad \mu :=\dfrac{\log (g_k(\gamma ))}{\log \alpha }, \quad A:=16.4,\quad \text {and}\quad B:=\alpha . \end{aligned}$$

As seen before, we have \({\widehat{\gamma }}\not \in {\mathbb {Q}}\).

For each \(k\in [3,380]\), we find a good approximation of \({\widehat{\gamma }}\) and a convergent \(p_\ell /q_\ell \) of the continued fraction of \({\widehat{\gamma }}\) such that \(q_\ell >6M_k\) and \(\varepsilon =\varepsilon (k)=||\mu q_\ell ||-M_k || {\widehat{\gamma }}q_\ell ||>0\), where \(M_k=\lfloor 7.3 \times 10^{15} k^5 \log ^3 k\rfloor \), which is an upper bound of \(n-1\) from Lemma 4.1. After doing this, we use Lemma 2.2 on inequality (4.9). A computer search with Mathematica revealed that the maximum value of \(\dfrac{\log (Aq_\ell /\varepsilon )}{\log B}\) over all \(k\in [3,380]\) is \(277.974\cdots \), which according to Lemma 2.2 is an upper bound on m. Hence, we deduce that the possible solutions (mnk) of Eq. (1.3) for which \(k\in [3,380]\) have \(m\le 278\), therefore \(n\le 119\), since \(n<(m+6)/2.4.\)

Finally, we used Mathematica to compare \(P_n^{(k)}\) and \(E_m\) for the range \(5 \le n \le 119\) and \(7 \le m \le 278\), with \(m <n/0.28\) and checked that Eq. (1.3) has no solution. \(\square \)

4.4 The case \( k> 380\)

In this final step, we analyze the case \(k> 380\) and prove the following result.

Lemma 4.3

The Diophantine equation (1.3) has no solution when \(k> 380\) and \(n\ge k+2\).

Proof

For \(k>380\), we have

$$\begin{aligned} 0.28m<n< 7.3 \times 10^{15} k^5 \log ^3 k<\varphi ^{k/2}. \end{aligned}$$

So, from (4.3) and (2.16), one gets

$$\begin{aligned} \left| \dfrac{\varphi ^{2n}}{\varphi +2}-\alpha ^m\right| \le \left| g_k(\gamma )\gamma ^n-\alpha ^m\right| +\dfrac{\varphi ^{2n}\left| \zeta \right| }{\varphi +2}\le 2.3+\dfrac{4\varphi ^{2n}}{(\varphi +2)\varphi ^{k/2}} \end{aligned}$$

which gives

$$\begin{aligned} \left| 1-(\varphi +2) \cdot \varphi ^{-2n}\cdot \alpha ^m\right| < \dfrac{12.4}{\varphi ^{k/2}}, \end{aligned}$$
(4.10)

where we have used the fact that \(1/2^{n-1}<1/2^{k/2}\) as \(n\ge k+2\). We use Theorem 2.1 to obtain a lower bound to the left-hand side of inequality (4.10). We consider

$$\begin{aligned} s:=3,\quad (\eta _1,b_1):=(\varphi +2,1), \quad (\eta _2,b_2):=(\varphi ,-2n)\quad \text {and}\quad (\eta _3,b_3):=(\alpha ,m). \end{aligned}$$

One can see that \(\eta _1, \eta _2,\eta _3\in {\mathbb {K}}:={\mathbb {Q}}(\alpha ,\sqrt{5})\) so \(d_{{\mathbb {K}}}= 6\). The left-hand side of (4.10) is not zero. Indeed, if this were zero, then we would get \(\alpha ^{m}=\dfrac{\varphi ^{2n}}{\varphi +2}\in {\mathbb {Q}}(\sqrt{5})\). But \({\mathbb {Q}}(\alpha )\cap {\mathbb {Q}}(\sqrt{5})={\mathbb {Q}}\) and so \(m=0\), which is impossible.

The fact that \(m\le 3.5n\) implies that we can choose \(B:=3.5n\). On the other hand, since

$$\begin{aligned} h(\eta _1)\le h(\varphi )+h(2)+\log 2\le \dfrac{\log \varphi }{2}+2\log 2 ,\quad h(\eta _2)=\dfrac{\log \varphi }{2},\quad h(\eta _3)=\dfrac{\log \alpha }{3}, \end{aligned}$$

it follows that

$$\begin{aligned}{} & {} \max \{6h(\eta _1),\left| \log \eta _1\right| , 0.16\}<9.8 :=A_1,\\{} & {} \max \{6h(\eta _1),\left| \log \eta _1\right| , 0.16\} <1.45 :=A_1, \end{aligned}$$

and

$$\begin{aligned} \max \{6h(\eta _2),\left| \log \eta _2\right| , 0.16\} <0.57 :=A_3. \end{aligned}$$

So, Theorem 2.1 tells us that

$$\begin{aligned} \left| 1-(\varphi +2) \cdot \varphi ^{-2n}\cdot \alpha ^m\right| > \exp \left( -1.51\times 10^{12} \log n\right) , \end{aligned}$$
(4.11)

where we have used the fact that \(1+\log (3.5n)<2.4\log n \), for \(n\ge 5\). Comparing (4.10) and (4.11), we obtain

$$\begin{aligned} k<6.28\times 10^{12}\log n. \end{aligned}$$

By Lemma 4.1 and using the fact that \(36.6+5\log k +3\log \log k<12.2\log k\) for \(k>380\), we get

$$\begin{aligned} \begin{array}{rcl} k&{}<&{}6.28\times 10^{12}\log (7.3\times 10^{15} k^5\log ^3k)\\ &{}<&{} 6.28\times 10^{12}(36.6+5\log k +3\log \log k)\\ &{}<&{} 7.67 \times 10^{13} \log k. \end{array} \end{aligned}$$

Hence, we obtain

$$\begin{aligned} k<2.73\times 10^{15}. \end{aligned}$$

Lemma 4.1 implies that

$$\begin{aligned} n<5 \times 10^{97}\quad \text {and}\quad m<1.8 \times 10^{98}. \end{aligned}$$
(4.12)

Put

$$\begin{aligned} \Gamma _4:=m\log \alpha -2n\log \varphi +\log (\varphi +2). \end{aligned}$$

Using a method similar to the one used to prove the inequality (3.9), we show that

$$\begin{aligned} 0<\left| \Gamma _4\right| < \dfrac{24.8}{\varphi ^{k/2}}, \end{aligned}$$
(4.13)

for \(k>380\). Replacing \(\Gamma _4\) in the above inequality and dividing across by \(\log \varphi \), one gets

$$\begin{aligned} 0<\left| m \left( \dfrac{\log \alpha }{\log \varphi }\right) -2n + \dfrac{\log (\varphi +2)}{\log \varphi }\right| <51.6\cdot \varphi ^{-k/2}. \end{aligned}$$
(4.14)

In order to apply Lemma 2.2, we put

$$\begin{aligned} {\widehat{\gamma }}:=\dfrac{\log \alpha }{\log \varphi }, \quad \mu := \dfrac{\log (\varphi +2)}{\log \varphi }, \quad A:=51.6 \quad \text {and},\quad B:=\varphi . \end{aligned}$$

The bounds (3.13) enable us to take \(M:=1.8 \times 10^{98}\). Using Maple, we find that \(q_{200}\) satisfies the hypotheses of Lemma 2.2, and we get

$$\begin{aligned} \dfrac{k}{2}< 491. \end{aligned}$$
(4.15)

With this new upper bound on k we get

$$\begin{aligned} n<2.19\times 10^{33} \quad \text {and} \quad m< 7.83\times 10^{33}. \end{aligned}$$

We apply again Lemma 2.2 with \(X_0:=7.83\times 10^{33}\) and \(q=q_{66}\) in this time, we get \(k< 366\), which contradicts our assumption that \(k>380\). Hence, we have shown that there are no solutions (nkm) to Eq. (1.3) with \(k>380\). \(\square \)

Therefore, Theorem 1.2 is proved.