1 Introduction

The Padovan numbers \((P_{n})_{n\ge 0}\) are defined by the Fibonacci–like recurrence relation

$$\begin{aligned} P_{n+3}=P_{n+1}+P_{n}\quad \text {for}\; n\ge 0, \end{aligned}$$

with initial conditions \(P_{0}=P_{1}=P_{2}=1\). The first of these numbers for \(n\ge 0\) are

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

The Perrin numbers \((R_m)_{m\ge 0}\) satisfy the same recurrence equation as Padovan numbers, but with different initial values. The first Perrin numbers for \(m\ge 0\) are

$$\begin{aligned} 3,\,0,\,2,\,3,\,2,\,5,\,5,\,7,\,10,\,12,\,17,\,22,\,29,\,39,\,51,\,\ldots \end{aligned}$$

Therefore, both sequences share the same characteristic polynomial given by \(X^{3}-X-1\). Since the constant term of this polynomial is \(-1\), these sequences can be extended to negative indices. We call these sequences n–Padovan and n–Perrin. These sequences are linear recursive with characteristic polynomial \(-X^{3}-X^{2}+1\) and, therefore, have integer members as well. The first n–Padovan and n–Perrin numbers for \(n,m\le -1\) are respectively

$$\begin{aligned} 0,\,1,\,0,\,0,\,1,\,-1,\,1,\,0,\,-1,\,2,\,-2,\,1,\,1,\,-3,\,4,\,-3,\,0,\,4,\,-7,\,7,\,-3,\ldots \end{aligned}$$

and

$$\begin{aligned} -1,\,1,\,2,\,-3,\,4,\,-2,\,-1,\,5,\,-7,\,6,\,-1,\,-6,\,12,\,-13,\,7,\,5,\,-18,\,25,\ldots . \end{aligned}$$

One of the basic questions in the theory of linear recurrences is the description of the common terms of recurrences. Evertse [8] and Laurent [10] proved ineffectively that only a finite number of common terms can occur. Effective version is known only for the equations \(u_{n}=u_{m}\) provided that the characteristic polynomial of \((u_{n})\) has at most three roots with the same absolute value and for \(u_{n}=v_{m}\) when both recurrences have dominating simple and real roots. The book of Shorey and Tijdeman [15] gives detailed overview on the related results.

In 2020, Bravo et al. [3, 4] established all solutions of equation

$$\begin{aligned} T_{n}=T_{m} \end{aligned}$$

in integers nm, where \((T_n)_{n\ge 0}\) denotes the Tribonacci sequence, which is defined by the initial terms \(T_{0}=T_{1}=0\), \(T_{1}=1\) and by the recursion \(T_{n+3}=T_{n+2}+T_{n+1}+T_{n}\) for \(n\ge 0\). Pethő [13] generalized the results of Bravo et al. [3, 4] to generalized Fibonacci numbers, showing that equation

$$\begin{aligned} F_{n}^{(k)}=F_{m}^{(\ell )} \end{aligned}$$

has only finitely many solutions \((n,m)\in {\mathbb {Z}}^{2}\) for fixed \(k\ge \ell \ge 2\), where \(\big (F_{n}^{(k)}\big )_{n\ge -k+2}\) denotes the generalized Fibonacci sequence, which is defined by the initial values \(F_{n}^{(k)}=0\) for \(n=0,\ldots ,-k+2\), \(F_{1}^{(k)}=1\) and by the \(k\ge 2\) fixed order recursion \(F_{n+k}^{(k)}=F_{n+k-1}^{(k)}+\cdots +F_{n}^{(k)}\) for \(n\ge -k+2\). Of course, for \(k=3\), we get the Tribonacci sequence. Unfortunately, the proof of Pethő [13] is ineffective, since it is based on the theory of S-unit equations. See also Pethő and Szalay [14].

The results of Bravo et al. [3, 4] were also generalized by Pethő [12] by solving effectively the equation

$$\begin{aligned} u_{n}=v_{m} \end{aligned}$$

in positive integers nm, where \((u_n)\) and \((v_{m})\) denote linear recursive sequences, such that the first has dominating real root \(\alpha \), while the second has a dominating pair \(\beta \), \({\overline{\beta }}\) of conjugate complex numbers, such that \(\alpha \) and \(|\beta |\) are multiplicatively dependent.

Here, we consider solving equation

$$\begin{aligned} P_{n}=\pm R_{m} \end{aligned}$$
(1.1)

for \((n,m)\in {\mathbb {Z}}^{2}\). Recently, using the theory of linear forms in logarithms and an application of the LLL algorithm, Bravo [1, Corollary 2] solved Eq. (1.1) for \(n,m\ge 0\). It has exactly 10 solutions, namely

$$\begin{aligned} P_{3}=P_{4}&=2=R_{2}=R_{4};\\ P_{5}&=3=R_{0}=R_{3};\\ P_{7}&=5=R_{5}=R_{6};\\ P_{8}&=7=R_{7};\\ P_{10}&=12=R_{9}. \end{aligned}$$

To solve completely Eq. (1.1), we solve the equations

$$\begin{aligned} P_{-n}=\pm R_{m},\quad P_{n}=\pm R_{-m},\quad \text {and}\quad P_{-n}=\pm R_{-m} \end{aligned}$$

for \(n,m\ge 0\), using the technique developed by Bravo et al. [3, 4].

2 Results

Theorem 2.1

The only solutions of equation

$$\begin{aligned} P_{-n}=\pm R_{m} \end{aligned}$$
(2.1)

for \(n,m\ge 0\) are the 24 that we list below

$$\begin{aligned} P_{-35}=P_{-19}=-7&=-R_{7};\\ P_{-21}=P_{-16}=P_{-14}=-3&=-R_{0}=-R_{3};\\ P_{-11}=-2&=-R_{2}=-R_{4};\\ P_{-17}=P_{-8}=P_{-4}=P_{-3}=P_{-1}=0&=\pm R_{1};\\ P_{-10}=2&=R_{2}=R_{4};\\ P_{-20}=7&=R_{7};\\ P_{-25}=10&=R_{8}. \end{aligned}$$

Theorem 2.2

The only solutions of equation

$$\begin{aligned} P_{n}=\pm R_{-m} \end{aligned}$$
(2.2)

for \(n,m\ge 0\) are the 30 ones listed below

$$\begin{aligned} P_{2}=P_{1}=P_{0}&=1=R_{-2}=-R_{-1}=-R_{-7}=-R_{-11}=-R_{-29};\\ P_{4}=P_{3}&=2=R_{-3}=R_{-20}=-R_{-6};\\ P_{5}&=3=-R_{-4};\\ P_{6}&=4=R_{-5};\\ P_{7}&=5=R_{-8}=R_{-16};\\ P_{8}&=7=R_{-15}=-R_{-9};\\ P_{10}&=12=R_{-13};\\ P_{12}&=21=-R_{-25};\\ P_{17}&=86=R_{-34}. \end{aligned}$$

Theorem 2.3

All solutions of equation

$$\begin{aligned} P_{-n}=\pm R_{-m} \end{aligned}$$
(2.3)

for \((n,m)\in {\mathbb {Z}}^{+}\times {\mathbb {Z}}^{+}\) are the 59 given below

$$\begin{aligned} P_{-35}=P_{-19}=-7&=R_{-9}=-R_{-15};\\ P_{-22}=-4&=-R_{-5};\\ P_{-21}=P_{-16}=P_{-14}=-3&=R_{-4};\\ P_{-11}=-2&=-R_{-3}=R_{-6}=-R_{-20};\\ P_{-9}=P_{-6}=-1&=R_{-1}=-R_{-2}=R_{-7}\\&=R_{-11}=R_{-29};\\ P_{-26}=P_{-13}=P_{-12}=P_{-7}=P_{-5}=P_{-2}=1&=-R_{-1}=R_{-2}=-R_{-7}\\&=-R_{-11}=-R_{-29};\\ P_{-10}=2&=R_{-3}=-R_{-6}=R_{-20};\\ P_{-18}=P_{-15}=4&=R_{-5};\\ P_{-20}=7&=-R_{-9}=R_{-15};\\ P_{-28}=25&=R_{-18}. \end{aligned}$$

Bravo [1, Corollary 2] and our main results yield:

Corollary 2.4

There are exactly 123 solutions of Eq. (1.1) in integers nm.

Corollary 2.5

The only common values of Padovan and Perrin sequences are 0, \(\pm 1\), \(\pm 2\), \(\pm 3\), \(4, 5, \pm 7, 10, 12, 25, 86\).

3 The Padovan and Perrin Sequences

We begin by recalling some properties of these ternary recurrence sequences. First, their characteristic polynomial is given by \(\Psi (X)=X^{3}-X-1\). Denoting its roots by \(\rho ,\beta ,\gamma \), being \(\rho \) the only real root, an analytic expression of the kth term of the Padovan and Perrin sequences can be given, respectively, by

$$\begin{aligned} P_{k}=c_{\rho }\rho ^{k}+c_{\beta }\beta ^{k}+c_{\gamma }\gamma ^{k} \end{aligned}$$
(3.1)

and

$$\begin{aligned} R_{k}=\rho ^{k}+\beta ^{k}+\gamma ^{k}, \end{aligned}$$
(3.2)

where

$$\begin{aligned} c_{\rho }=\frac{7\rho ^{2}+\rho +3}{23},\quad c_{\beta }=\frac{7\beta ^{2}+\beta +3}{23},\quad \text {and}\quad c_{\gamma }=\overline{c_{\beta }}. \end{aligned}$$

Here

$$\begin{aligned} \rho =\root 3 \of {\frac{9+\sqrt{69}}{18}}+\root 3 \of {\frac{9-\sqrt{69}}{18}} \end{aligned}$$

is called the plastic constant, and it is the smallest Pisot number (see Siegel [16]). Furthermore

$$\begin{aligned} \beta =\rho ^{-1/2}z \quad \text {and} \quad \gamma =\rho ^{-1/2}z^{-1}, \end{aligned}$$
(3.3)

where \(z:=e^{i\theta }\) and \(\theta \in \left( 0,\pi \right) \). Numerically

$$\begin{aligned} \begin{array}{c} 1.32<\rho<1.33, \qquad 0.86<|\beta |=|\gamma |=\rho ^{-1/2}<0.87, \\ 0.72<c_{\rho }<0.73, \qquad 0.24<|c_{\beta }|=|c_{\gamma }|=(23c_{\rho })^{-1/2}<0.25. \end{array} \end{aligned}$$

In addition, it can be shown by induction that

$$\begin{aligned} \rho ^{n-2}\le P_{n}\le \rho ^{n-1}\quad \text {for all}\; n\ge 4, \end{aligned}$$
(3.4)

and

$$\begin{aligned} \rho ^{m-2}\le R_{m}\le \rho ^{m+1}\quad \text {for all}\; m\ge 2. \end{aligned}$$
(3.5)

The following results similar to (3.4) and (3.5) for \(|P_{-n} |\) and \(|R_{-m} |\) were proved by using linear forms in logarithms by Bravo and Luca [6, Lemma 2] and Bravo, Bravo, and Luca [2, Lemma 11], respectively:

$$\begin{aligned}{} & {} \rho ^{\frac{n}{2}-9.4\times 10^{15}\log n}<|P_{-n} |<0.51\rho ^{n/2}\quad \text {for all}\; n\ge 18. \end{aligned}$$
(3.6)
$$\begin{aligned}{} & {} \rho ^{\frac{m}{2}-3\times 10^{15}\log m}<|R_{-m}|<2.01\rho ^{m/2}\quad \text {for all}\; m\ge 6. \end{aligned}$$
(3.7)

From the result of de Weger [17, Theorem 3], it follows that the Padovan sequence \((P_{k})_{k\in {\mathbb {Z}}}\) has five zeros (for a different proof of this result, see Bravo, Bravo, and Luca [2, Theorem 1]). For \((R_{k})_{k\in {\mathbb {Z}}}\), Bravo, Bravo, and Luca [2, Corollary 3] proved that the Perrin sequence has one zero. More precisely

$$\begin{aligned} P_{k}=0\quad \text {if and only if}\quad k\in \{-1,-3,-4,-8,-17\}, \end{aligned}$$
(3.8)

and

$$\begin{aligned} R_{k}=0\quad \text {if and only if}\quad k=1. \end{aligned}$$
(3.9)

We end this section of preliminaries on the Padovan and Perrin sequences by mentioning that we can identify the automorphisms of the Galois group of the splitting field \({\mathbb {K}}={\mathbb {Q}}(\alpha ,\beta )\) of \(\Psi \) over \({\mathbb {Q}}\) with the permutations of the roots of \(\Psi \), since

$$\begin{aligned} \text {Gal}\bigl ({\mathbb {K}}/{\mathbb {Q}}\bigr )\simeq \left\{ \left( 1\right) ,\left( \alpha \beta \right) ,\left( \alpha \gamma \right) ,\left( \beta \gamma \right) ,\left( \alpha \beta \gamma \right) ,\left( \alpha \gamma \beta \right) \right\} \simeq S_{3}. \end{aligned}$$

For example, the permutation \(\left( \rho \beta \gamma \right) \) corresponds to the automorphism \(\sigma _{\rho \beta \gamma }:\rho \rightarrow \beta ,\,\beta \rightarrow \gamma ,\,\gamma \rightarrow \rho \) (\(\sigma _{\rho \beta \gamma }:c_{\rho }\rightarrow c_{\beta },\,c_{\beta }\rightarrow c_{\gamma },\,c_{\gamma }\rightarrow c_{\rho }\)).

4 Linear Forms in Logarithms

For an algebraic number \(\alpha \) of degree d over \({\mathbb {Q}}\) with minimal primitive polynomial

$$\begin{aligned} a_{d}X^{d}+a_{d-1}X^{d-1}+\cdots +a_{0}=a_{d}\big (X-\alpha ^{(1)}\big )\cdots \big (X-\alpha ^{(d)}\big )\in {\mathbb {Z}}\left[ X\right] , \end{aligned}$$

we put

$$\begin{aligned} h(\alpha )=\dfrac{1}{d}\Bigg (\log (|a_d|) + \sum _{j=1}^{d}\max \big \{\log (|\alpha ^{(j)}|),0\big \}\Bigg ) \end{aligned}$$

for the logarithmic height of \(\alpha :=\alpha ^{(1)}\). The following are some basic properties of this height that will be used later without reference:

$$\begin{aligned} h(\alpha )= & {} h\big (\alpha ^{(j)}\big ),\\ h(\alpha _{1}+\alpha _{2})\le & {} h(\alpha _{1})+h(\alpha _{2})+\log 2,\, h\big (\alpha _{1}\alpha _{2}^{\pm 1}\big )\le h(\alpha _{1})+h(\alpha _{2}), \\ h\big (\alpha ^{\frac{p}{q}}\big )= & {} \big |\tfrac{p}{q}\big |\,h(\alpha ),\\ h\big (\tfrac{p}{q}\big )= & {} \log \max \{|p|,q\}\,\,\,\left( \tfrac{p}{q}\in {\mathbb {Q}},\, q>0,\,\gcd (p,q)=1\right) . \end{aligned}$$

Next, we give the general lower bound for linear forms in logarithms due to Matveev [11]. Let \({\mathbb {K}}\) be a number field of degree D over \({\mathbb {Q}}\), let \(\alpha _{1},\ldots ,\alpha _{t}\) be non-zero elements of \({\mathbb {K}}\), and let \(b_{1},\ldots ,b_{t}\) be integers. Set

$$\begin{aligned} \Lambda =\alpha _{1}^{b_1}\cdots \alpha _{t}^{b_t} - 1\quad \text {and}\quad B \ge \max \left\{ |b_1 |,\ldots ,|b_t|\right\} . \end{aligned}$$

Let \(A_{1},\ldots ,A_{t}\) be real numbers, such that

$$\begin{aligned} A_{j}\ge \max \big \{Dh(\alpha _{j}),\,|\log \alpha ^{(j)}|,\,0.16\big \},\quad 1\le j\le t. \end{aligned}$$

With this notation, the main result of Matveev [11] implies the following estimate.

Theorem 4.1

If \(\Lambda \ne 0\) and \({\mathbb {K}}\subseteq {\mathbb {C}}\), we have

$$\begin{aligned} |\Lambda |>\exp \big (-3 \cdot 30^{t+4}(t+1)^{5.5} D^2 A_1\cdots A_t (1 + \log D)(1 + \log (tB))\big ). \end{aligned}$$

5 Reduction Tools

Next, we remind the Baker–Davenport reduction method from Bravo, Gómez, and Luca [5, Lemma 1], which is an immediate variation of a result due to Dujella and Pethő [7, Lemma 5(a)], which turns out to be useful to reduce the bounds arising from applying Theorem 4.1.

Lemma 5.1

Suppose that M is a positive integer. Let p/q be a convergent of the continued fraction of \(\kappa \), such that \(q>6M\). Let \(A,B,\mu \) be real numbers with \(A>0\) and \(B>1\). Set \(\epsilon =\left\| \mu q\right\| -M\left\| \kappa q\right\| \), where \(\left\| \cdot \right\| \) denotes the distance from the nearest integer. If \(\epsilon >0\), then there is no solution of the inequality

$$\begin{aligned} 0<|s\kappa -r+\mu |<AB^{-w} \end{aligned}$$

in positive integers \(r,\,s,\,w\), with \(s\le M\) and \(w \ge \log \,(Aq/\epsilon )/\log B\).

The above Lemma 5.1 cannot be applied when \(\mu =0\), since then \(\epsilon <0\). In this case, we use the following result well known in the theory of continued fractions. A proof of it follows from Hardy and Wright [9, Theorem 150, Theorem 182].

Lemma 5.2

Let \(p_{0}/q_{0},p_{1}/q_{1},\ldots \) be the convergents of the continued fraction \(\left[ a_{0},a_{1},\ldots \right] \) of the irrational number \(\kappa \). Let M be a positive integer and put \(a_{M}=\max \{a_{j}: 0\le j\le N+1\}\), where N is a non-negative integer, such that \(q_{N}\le M <q_{N+1}\). If \(r,\,s \in {\mathbb {Z}}\), then

$$\begin{aligned} \bigg |\kappa -\frac{r}{s}\bigg |>\frac{1}{(a_{M}+2)s^{2}}\quad \text {for all}\quad 0<s<M. \end{aligned}$$

6 The Proof of Theorem 2.1

Assume that \(n\ge 18\) and \(m\ge 2\). Using (3.5) and (3.6) in Eq. (2.1), we get

$$\begin{aligned} \rho ^{\frac{n}{2}-9.4\times 10^{15}\log n}< |P_{-n}|=|\pm R_{m}|=R_{m}\le \rho ^{m+1}. \end{aligned}$$

Taking logarithms in the inequality that results above, we obtain

$$\begin{aligned} n-2m<1.88\times 10^{16}\log n. \end{aligned}$$

On the other hand, it also follows from (3.5) and (3.6) in equation (2.1) that:

$$\begin{aligned} \rho ^{m-2}\le R_{m}=|\pm R_{m}|=|P_{-n}|<0.51\rho ^{n/2}. \end{aligned}$$

Taking logarithms in the resulting inequality above, we get

$$\begin{aligned} n-2m>0.789087. \end{aligned}$$

We recorded what we just showed.

Lemma 6.1

If (nm) is a solution of Eq. (2.1) with \(n\ge 18\) and \(m\ge 2\), then \(n-2m\in \left[ 1,1.88\times 10^{16}\log n\right) \).

On using now (3.1), (3.2), and (3.3) in Eq. (2.1) with \(\varepsilon :=\pm 1\), we get

$$\begin{aligned} \rho ^{m}\big (c_{\beta }\rho ^{(n-2m)/2}z^{-n}+c_{\gamma }\rho ^{(n-2m)/2}z^{n}-\varepsilon \big )=\varepsilon (\beta ^{m}+\gamma ^{m})-c_{\rho }\rho ^{-n}. \end{aligned}$$
(6.1)

However

$$\begin{aligned} c_{\beta }\rho ^{\frac{n-2m}{2}}z^{-n}+c_{\gamma }\rho ^{\frac{n-2m}{2}}z^{n}-\varepsilon&=c_{\gamma }\rho ^{\frac{n-2m}{2}}z^{-n}\bigg (z^{2n}-\frac{\varepsilon }{c_{\gamma }\rho ^{\frac{n-2m}{2}}}z^{n}+\frac{c_{\beta }}{c_{\gamma }}\bigg )\\&=c_{\gamma }\rho ^{(n-2m)/2}z^{-n}(z^{n}-y_{1})(z^{n}-y_{2}), \end{aligned}$$

where \(y_{1},\,y_{2}\) are the roots of the trinomial

$$\begin{aligned} y^{2}-\frac{\varepsilon }{c_{\gamma }\rho ^{(n-2m)/2}}y+\frac{c_{\beta }}{c_{\gamma }}. \end{aligned}$$
(6.2)

From (6.1), we get then that

$$\begin{aligned} c_{\gamma }\rho ^{n/2}z^{-n}(z^{n}-y_{1})(z^{n}-y_{2})=\varepsilon (\beta ^{m}+\gamma ^{m})-c_{\rho }\rho ^{-n}. \end{aligned}$$

Dividing the above equation by \(c_{\gamma }\rho ^{n/2}\) and taking absolute value, we get

$$\begin{aligned} |(z^{n}-y_{1})(z^{n}-y_{2})|<\frac{6.6}{\rho ^{n/2}}. \end{aligned}$$
(6.3)

Now, we use Theorem 4.1 for \(|\Lambda _{1}|:=|z^{n}-y_{1}|=|y_{1}z^{-n}-1|\). The lower bound we obtain for \(|\Lambda _{1}|\) is the same as the one we would obtain for \(|\Lambda _{2}|\) with \(\Lambda _{2}:=z^{n}-y_{2}\) since \(h(y_{1})=h(y_{2})\). We put

$$\begin{aligned} \alpha _{1}:=y_{1}=\frac{\varepsilon c_{\gamma }^{-1}\rho ^{(2m-n)/2}+\sqrt{c_{\gamma }^{-2}\rho ^{2m-n}-4c_{\beta }c_{\gamma }^{-1}}}{2},\quad \alpha _{2}:=z,\quad b_{1}:= 1, \end{aligned}$$

and \(b_{2}:=-n\). Note that \(\alpha _{1},\alpha _{2}\in {\mathbb {K}}:={\mathbb {Q}}\Big (\sqrt{\rho },\beta , \sqrt{c_{\gamma }^{-2}\rho ^{2\,m-n}-4c_{\beta }c_{\gamma }^{-1}}\,\Big )\). Let \({\mathbb {L}}={\mathbb {Q}}\big (\sqrt{\rho },\beta \big )\). Then, we have \({\mathbb {K}}={\mathbb {L}}\Big (\sqrt{c_{\gamma }^{-2}\rho ^{2m-n}-4c_{\beta }c_{\gamma }^{-1}}\,\Big )\). Thus, \(D=\big [{\mathbb {K}}:{\mathbb {Q}}\big ]=\big [{\mathbb {K}}:{\mathbb {L}}\big ]\big [{\mathbb {L}}:{\mathbb {Q}}\big ]\le 2(12)=24\), and as \(n\ge 18\) we take \(B:=n\). Additionally, it is a straightforward exercise to check that

$$\begin{aligned} h(y_{i})\le h(b)+h(c)+\log 2,\quad i=1,2, \end{aligned}$$
(6.4)

where \(y_{1},y_{2}\) are the roots of the trinomial \(y^{2}+by+c\in {\mathbb {C}}[y]\). If \(b=-\varepsilon /c_{\gamma }\rho ^{(n-2\,m)/2}\) and \(c=c_{\beta }/c_{\gamma }\), then \(h(\alpha _{1})\le \frac{|n-2\,m|}{2}h(\rho )+3\,h(c_{\beta })+\log 2<8.9\times 10^{14}\log n\), where we used the facts that \(|n-2\,m|<1.88\times 10^{16}\log n\) by Lemma 6.1, \(h(\rho )=(\log \rho )/3\), and \(h(c_{\beta })=h(c_{\gamma })=(\log 23)/3\). Therefore, we take \(A_{1}:=2.14\times 10^{16}\log n\). Furthermore, \(h(\alpha _{2})=\tfrac{1}{2}h(\beta /\gamma )\le (\log \rho )/3\), since \(z=\sqrt{\beta /\gamma }\) by (3.3). Therefore, we take \(A_{2}:=8\log \rho \). It remains to show that \(\Lambda _{1}\) is non-zero. If so, then, from (6.1), we get

$$\begin{aligned} \varepsilon \rho ^{m}=c_{\beta }\beta ^{-n}+c_{\gamma }\gamma ^{-n}. \end{aligned}$$

Conjugating the above relation by the automorphism \(\sigma _{\rho \beta \gamma }\), and then taking absolute value on both sides of the resulting equality, we get

$$\begin{aligned} |c_{\gamma }|\rho ^{n/2}\le \rho ^{-m/2}+c_{\rho }\rho ^{-n}, \end{aligned}$$

which is impossible for any \(n\ge 9\) and \(m\ge 2\). Thus, \(\Lambda _{1}\ne 0\). In addition, the proof that \(\Lambda _{2}\ne 0\) is the same as \(\Lambda _{1}\ne 0\). Now, Theorem 4.1 implies that

$$\begin{aligned} \exp \left( -3.42\times 10^{32}\log ^{2} n\right) <|(z^{n}-y_{1})(z^{n}-y_{2})|, \end{aligned}$$

where we used the fact that \(1+\log (2n)<1.6\log n\) for all \(n\ge 18\). Comparing (6.3) and the above last inequality, and then taking logarithms, we get

$$\begin{aligned} n<2.5\times 10^{33}\log ^{2}n, \end{aligned}$$

and therefore, \(n<1.8\times 10^{37}\). We record what we have shown so far.

Lemma 6.2

If (nm) is a solution of Eq. (2.1) with \(n\ge 18\) and \(m\ge 2\), then \(n<1.8\times 10^{37}\).

We begin with the reduction of the bound of \(n-2m\). Using (3.1), we get

$$\begin{aligned} \nonumber |P_{-n} |= & {} |c_{\beta }\beta ^{-n}+c_{\gamma }\gamma ^{-n}|\bigg |1+\frac{c_{\rho }\rho ^{-n}}{c_{\beta }\beta ^{-n}+c_{\gamma }\gamma ^{-n}}\bigg |\\ \nonumber= & {} |c_{\beta }||\beta |^{-n}\bigg |1+\frac{c_{\gamma }}{c_{\beta }}\bigg (\frac{\gamma }{\beta }\bigg )^{-n}\bigg |\bigg |1+\frac{c_{\rho }\rho ^{-n}}{c_{\beta }\beta ^{-n}+c_{\gamma }\gamma ^{-n}}\bigg |\\\nonumber> & {} 0.24\rho ^{n/2}\bigg |1+\frac{c_{\gamma }}{c_{\beta }}\bigg (\frac{\beta }{\gamma }\bigg )^{n}\bigg |\Bigg |1-\bigg |\frac{c_{\rho }\rho ^{-n}}{c_{\beta }\beta ^{-n}+c_{\gamma }\gamma ^{-n}}\bigg |\Bigg |\\> & {} 0.23972\rho ^{n/2}\bigg |\frac{c_{\gamma }}{c_{\beta }}\bigg (\frac{\beta }{\gamma }\bigg )^{n}+1\bigg |. \end{aligned}$$
(6.5)

In the above, we have also used that \(|c_{\rho }\rho ^{-n}/(c_{\beta }\beta ^{-n}+c_{\gamma }\gamma ^{-n})|<1.14506\times 10^{-3}\) for all \(n\ge 18\), which follows by (3.8), since:

$$\begin{aligned} |c_{\beta }\beta ^{-n}+c_{\gamma }\gamma ^{-n}|= & {} |P_{-n}-c_{\rho }\rho ^{-n}|\ge |P_{-n}|-c_{\rho } \rho ^{-n}\\\ge & {} 1-c_{\rho }\rho ^{-n}>873.31c_{\rho }\rho ^{-n}. \end{aligned}$$

Combining (2.1), (6.5) and the fact that \(R_{m}\le \rho ^{m+1}\) for all \(m\ge 2\) by (3.5), we obtain

$$\begin{aligned} \bigg |\frac{c_{\gamma }}{c_{\beta }}\bigg (\frac{\beta }{\gamma }\bigg )^{n}+1\bigg |<\frac{5.6}{\rho ^{(n-2m)/2}}. \end{aligned}$$
(6.6)

However, \((\beta /\gamma )^{n}=e^{2in\theta }\) by (3.3). Likewise, \(c_{\gamma }/c_{\beta }=e^{2i\omega }\) with \(\omega \in (0,2\pi )\). Therefore, (6.6) becomes

$$\begin{aligned} \big |e^{i(2n\theta +\pi +2\omega )}-1\big |<\frac{5.6}{\rho ^{(n-2m)/2}}. \end{aligned}$$
(6.7)

Let . Then, \(2n\theta +\pi +2\omega -r\pi \in \left[ -\pi /2,\pi /2\right] \). Hence

$$\begin{aligned} |e^{i(2n\theta +\pi +2\omega )}+1|\ge |\sin (2n\theta +\pi +2\omega )|\ge 2\bigg |\frac{2n\theta }{\pi }-(r-1)+\frac{2\omega }{\pi }\bigg |, \end{aligned}$$
(6.8)

where we used that

$$\begin{aligned} |\sin y|=\sin |y|\ge (2/\pi )|y|\quad \text {for all}\quad y\in \left[ -\pi /2,\pi /2\right] . \end{aligned}$$
(6.9)

Thus, we can conclude from inequalities (6.7) and (6.8) that

$$\begin{aligned} \bigg |\frac{2n\theta }{\pi }-(r-1)+\frac{2\omega }{\pi }\bigg |<2.8\rho ^{-(n-2m)/2}. \end{aligned}$$
(6.10)

We put

$$\begin{aligned} \kappa :=2\theta /\pi , \quad \mu :=2\omega /\pi , \quad A:=2.8,\quad \text {and}\quad B:=\sqrt{\rho }. \end{aligned}$$

We also put \(M=1.8\times 10^{37}\), which is an upper bound for n by Lemma 6.2. It then follows from Lemma 5.1 applied to inequality (6.10) that:

$$\begin{aligned} n-2m<\log \,(Aq_{73}/\epsilon )/\log B<647.949, \end{aligned}$$

where \(q_{73}=209509831018529557470433975207606463797\) is the denominator of the first convergent of the continued fraction of \(\kappa \), such that \(q_{73}>6M\) and \(\epsilon >0.159775\). Thus, \(n-2m\le 647\). If we repeat the argument after Lemma 6.1 until the upper bound for n with this new bound for \(n-2m\), we have to replace only \(A_{1}\) by 820, and we get \(n<9.31\times 10^{19}\log n\) which gives \(n<4.64\times 10^{21}\). Now, we apply Lemma 5.1 to inequality (6.10) with \(M=4.64\times 10^{21}\). In this case with \(q_{41}=56787231118705906647120\), we obtain that \(q_{41}>6\,M\), \(\epsilon >0.404707\) and then \(n-2m\le 386\). From the above and Lemma 6.1, we get that \(n-2\,m \in \left[ 1,386\right] \).

Next, we reduce the bound of n. If \(n-2m\in \left[ 1,5\right] \), then the trinomial (6.2) has complex roots, such that \(|y_{1}|>1\) and \(|y_{2}|<1\) or \(|y_{1}|<1\) and \(|y_{2}|>1\). In any case, we obtain from (6.3) that

$$\begin{aligned} |y_1|+|y_2|-|y_1y_2|-1\le |(z^{n}-y_{1})(z^{n}-y_{2})|<6.6\rho ^{n/2}. \end{aligned}$$

Taking logarithms in the resulting inequality above, we get

$$\begin{aligned} n<\frac{2\log \left( 6.6/(|y_1|+|y_2|-|y_1y_2|-1)\right) }{\log \rho }. \end{aligned}$$

The maximum value of the right-hand side of the above inequality is reached at \(n-2m=5\). In this case, \(|y_1|,|y_2|\in \{1.142280483\ldots ,0.8754417278\ldots \}\), and therefore, \(n<42.1054\). So that \(n\le 42\) for all \(n-2\,m\in \left[ 1,5\right] \).

From now on, we assume that \(n-2m\in \left[ 6,386\right] \). Since

$$\begin{aligned} |(z^{n}-y_{1})-(z^{n}-y_{2})|=\Big |\sqrt{c_{\gamma }^{-2}\rho ^{2m-n}-4c_{\beta }c_{\gamma }^{-1}}\Big |, \end{aligned}$$

it follows that \(|z^{n}-y_{j}|\ge c_{1}/2\) for some \(j\in \{1,2\}\) where:

$$\begin{aligned} c_{1}:=\min \bigg \{\Big |\sqrt{c_{\gamma }^{-2}\rho ^{2m-n}-4c_{\beta }c_{\gamma }^{-1}}\Big |:n-2m\in \left[ 6,386\right] \bigg \}. \end{aligned}$$

We now explain the calculations only in the case \(j=2\); namely, when \(|z^{n}-y_{2}|>c_{1}/2\), since for \(j=1\), they are similar. Then, by (6.3), we obtain

$$\begin{aligned} |z^{n}-y_{1}|<\frac{13.2}{c_{1}\rho ^{n/2}}. \end{aligned}$$

Now, we write \(y_{1}^{-1}=e^{i\phi _{n-2m}}\) where \(\phi _{n-2\,m} \in (0,2\pi )\), since the trinomial (6.2) has complex roots with modulus 1 for all \(n-2\,m\in \left[ 6,386\right] \). Dividing both sides of the above inequality by \(|y_{1}|\) and using that \(c_{1}=\Big |\sqrt{c_{\gamma }^{-2}\rho ^{-6}-4c_{\beta }c_{\gamma }^{-1}}\Big |>0.9626732778\), we get that

$$\begin{aligned} \big |e^{i(n\theta +\phi _{n-2m})}-1\big |<\frac{14}{\rho ^{n/2}}. \end{aligned}$$
(6.11)

Put . Then, \(n\theta +\phi _{n-2m}-r\pi \in \left[ -\pi /2,\pi /2\right] \) and by (6.9), we get

$$\begin{aligned} \big |e^{i(n\theta +\phi _{n-2m})}-1\big |\ge |\sin (n\theta +\phi _{n-2m})|\ge 2\bigg |\frac{n\theta }{\pi }-r+\frac{\phi _{n-2m}}{\pi }\bigg |, \end{aligned}$$

which together with (6.11) implies that

$$\begin{aligned} |n\kappa -r+\mu _{n-2m}|<AB^{-n}, \end{aligned}$$
(6.12)

where

$$\begin{aligned} \kappa :=\theta /\pi , \quad \mu _{n-2m}:=\phi _{n-2m}/\pi ,\quad A:=7,\quad \text {and}\quad B:= \sqrt{\rho }. \end{aligned}$$

Note that \(n<M:=4.64\times 10^{21}\). Here, we applied Lemma 5.1 to inequality (6.12) for each \(n-2\,m\in \left[ 6,386\right] \). By means of a computational search, we find that \(q_{46}=2340639420725066129293050\) is the denominator of the first convergent of the continued fraction of \(\kappa \), such that \(q_{46}>6\,M\), \(\min \{\epsilon :n-2\,m \in \left[ 6,386\right] \}>1.27921\times 10^{-4}\) and the maximum value of \(\log \,(Aq_{46}/\epsilon )/\log B\) is \(<444.158\). Thus, \(n\le 444\) for all \(n-2m\in \left[ 6,386\right] \).

In summary, in any case, we have proved the following result.

Lemma 6.3

All solutions (nm) of Eq. (2.1) are in the range \(n\le 444\) and \(m\le 221\).

A computational search shows that the 24 pairs (nm) given in Theorem 2.1 are the only solutions of Eq. (2.1) in the range given in Lemma 6.3. This completes the proof of Theorem 2.1.

7 The Proof of Theorem 2.2

This proof follows to a large extent the line of argument set out in the previous proof of Theorem 2.1. We omit some details. Using (3.4) and (3.7) in Eq. (2.2), we establish the following result.

Lemma 7.1

If (nm) is a solution of Eq. (2.2) with \(n\ge 4\) and \(m\ge 6\), then \(m-2n\in \left[ -8,6\times 10^{15}\log m\right) \).

Now, we use (3.1), (3.2), and (3.3) in Eq. (2.2) with \(\varepsilon :=\pm 1\), which gives us that

$$\begin{aligned} c_{\rho }\rho ^{n}-\varepsilon (\rho ^{m/2}z^{-m}+\rho ^{m/2}z^{m})=\varepsilon \rho ^{-m}-(c_{\beta }\beta ^{n}+c_{\gamma }\gamma ^{n}). \end{aligned}$$
(7.1)

Dividing the above equation by \(c_{\rho }\rho ^{n}\) and taking absolute value, we get that

$$\begin{aligned} \big |\varepsilon (c_{\rho }^{-1}\rho ^{(m-2n)/2}z^{-m}+c_{\rho }^{-1}\rho ^{(m-2n)/2}z^{m})-1\big |<\frac{0.65}{\rho ^{n}}. \end{aligned}$$
(7.2)

Note that

$$\begin{aligned} \varepsilon (c_{\rho }^{-1}\rho ^{\frac{m-2n}{2}}z^{-m}+c_{\rho }^{-1}\rho ^{\frac{m-2n}{2}}z^{m})-1=\varepsilon c_{\rho }^{-1}\rho ^{\frac{m-2n}{2}}z^{-m}(z^{m}-y_{1})(z^{m}-y_{2}), \end{aligned}$$

where \(y_{1},y_{2}\) are the roots of the trinomial

$$\begin{aligned} y^{2}-\frac{c_{\rho }}{\varepsilon \rho ^{(m-2n)/2}}y+1. \end{aligned}$$
(7.3)

Thus, (7.2) implies that

$$\begin{aligned} |(z^{m}-y_{1})(z^{m}-y_{2})|<\frac{0.47}{\rho ^{m/2}}. \end{aligned}$$
(7.4)

We apply Theorem 4.1 with the choices

$$\begin{aligned} \alpha _{1}:=y_{1}=\frac{\varepsilon c_{\rho }\rho ^{(2n-m)/2}+\sqrt{c_{\rho }^{2}\rho ^{2n-m}-4}}{2},\quad \alpha _{2}:=z,\quad b_{1}:=1, \end{aligned}$$

and \(b_{2}:=-m\). Here \(\alpha _{1},\alpha _{2}\in {\mathbb {K}}={\mathbb {Q}}\Big (\sqrt{\rho },\beta ,\sqrt{c_{\rho }^{2}\rho ^{2n-m}-4}\,\Big )\). As in the first application of Theorem 4.1, we take \(D\le 24\), \(A_{2}=8\log \rho \), and the proof that \(\Lambda _{3}:=\alpha _{1}^{b_{1}}\alpha _{2}^{b_{2}}-1\ne 0\) is similar to proof \(\Lambda _{1}\ne 0\) using (7.1) instead of (6.1). We also take \(A_{1}=6.96\times 10^{15}\log m\), since \(h(\alpha _{1})<\tfrac{1}{6}|m-2n|\log \rho +h(c_{\rho })+\log 2<2.9\times 10^{14}\log m\) by (6.4), Lemma 7.1, and the facts that \(h(\rho )=(\log \rho )/3\) and \(h(c_{\rho })=(\log 23)/3\). Summarizing we get

$$\begin{aligned} \exp \,(-3.46838\times 10^{31}\log m (1+\log \,(2m)))<|z^{m}-y_{i}|\end{aligned}$$

for \(i=1,2\) since \(h(y_{1})=h(y_{2})\). Moreover, the proof that \(\Lambda _{4}:=y_{2}z^{-m}-1\ne 0\) is the same as \(\Lambda _{3}\ne 0\). Thus

$$\begin{aligned} \exp \,(-6.93675\times 10^{31}\log m (1+\log \,(2m)))<|(z^{m}-y_{1})(z^{m}-y_{2})|. \end{aligned}$$
(7.5)

Combining (7.4), (7.5) and the fact that \(1+\log \,(2\,m)<2\log m\) for all \(m\ge 6\), we obtain in summary the following result.

Lemma 7.2

If (nm) is a solution of Eq. (2.2) with \(n\ge 4\) and \(m\ge 6\), then \(m<7.1\times 10^{36}\).

Using (3.2) and the fact that \(\big |\rho ^{-k}/\big (\beta ^{-k}+\gamma ^{-k}\big )\big |<(\rho -1)^{-1}\) for all \(k\ge 1\) (which follows by (3.9), since \(\big |\beta ^{-k}+\gamma ^{-k}\big |=\big |R_{-k}-\rho ^{-k}\big |\ge |R_{-k}|-\rho ^{-k}\ge 1-\rho ^{-k}>(\rho -1)\rho ^{-k}\)), we have

$$\begin{aligned} |R_{-k}|>2\rho ^{k/2}\bigg |\bigg (\frac{\beta }{\gamma }\bigg )^{k}+1\bigg |. \end{aligned}$$
(7.6)

Now, we use that \(P_{n}\le \rho ^{n-1}\) for all \(n\ge 4\) (by (3.4)) on the left-hand side of (2.2), and (7.6) with \(k=m\) on the right-hand side. The above is to reduce \(m-2n\) as we did with \(n-2m\) in the proof of Theorem 2.1. This time we obtain

$$\begin{aligned} \bigg |\frac{\theta }{\pi }-\frac{r}{m}\bigg |<\frac{0.1}{\rho ^{(m-2n)/2}m}, \end{aligned}$$
(7.7)

where now . Next, we apply Lemma 5.2. We put \(\kappa =\theta /\pi \), and compute its continued fraction \(\left[ a_{0},a_{1},\ldots \right] =\left[ 0,1,3,2,6,3,25,1,1,7,1,\ldots \right] \), and its convergents

$$\begin{aligned} \left\{ \frac{p_{j}}{q_{j}}:j=0,1,\ldots \right\} =\left\{ 0,\,1,\,\frac{3}{4},\,\frac{7}{9},\,\frac{45}{58},\,\frac{142}{183},\,\frac{3595}{4633},\ldots \right\} . \end{aligned}$$

Furthermore, we note that \(m<7.1\times 10^{36}:=M\) according to Lemma 7.2, and it follows that \(q_{68}<M<q_{69}\) and \(a_{M}= \max \left\{ a_{j}:0\le j\le 69\right\} =a_{11}=3550\). Then, by Lemma 5.2, we have that

$$\begin{aligned} \bigg |\frac{\theta }{\pi }-\frac{r}{m}\bigg |>\frac{1}{3552m^{2}}. \end{aligned}$$
(7.8)

Hence, combining the inequalities (7.7) and (7.8) and taking into account that \(m<7.1\times 10^{36}\) by Lemma 7.2, we obtain

$$\begin{aligned} m-2n<\frac{2\log \big (0.1\cdot 3552\cdot 7.1\times 10^{36}\big )}{\log \rho }<645.277. \end{aligned}$$

Repeating the argument after Lemma 7.1 up to the upper bound for m with this new bound for \(m-2n\), we have to substitute only \(A_{1}\) for 728, and we get \(m<5.2\times 10^{21}\). We now repeat the reduction of \(m-2n\) using Lemma 5.2 again now with \(M=5.2\times 10^{21}\). This time, \(q_{39}<M<q_{40}\) so \(a_{M}= \max \left\{ a_{j}:0\le j\le 40\right\} =a_{11}=3550\) and we arrive again at (7.8). Combining (7.7) and (7.8) with this new bound for m, we get that \(m-2n\le 397\). From the above and Lemma 7.1, we have that \(m-2n\in \left[ -8,397\right] \).

Next, we reduce the bound of m when \(m-2n=-8\). In this case, the trinomial (7.3) has real roots, such that \(|y_{1}|,|y_{2}|\in \{1.598113\ldots ,0.625738\ldots \}\). From (7.4), it follows that:

$$\begin{aligned} (1-|y_2|)(|y_{1}|-1)\le |(z^{m}-y_{1})(z^{m}-y_{2})|<\frac{0.47}{\rho ^{m/2}}; \end{aligned}$$

therefore

$$\begin{aligned} m<\frac{2\log \left( 0.47/(1-|y_2|)(|y_{1}|-1)\right) }{\log \rho }<5.27562. \end{aligned}$$

Now, we reduce the bound of m when \(m-2n\in \left[ -7,397\right] \). As

$$\begin{aligned} c_{2}:=\min \Big \{\Big |\sqrt{c_{\rho }^{2}\rho ^{2n-m}-4}\Big |:m-2n \in \left[ -7,397\right] \Big \}=\Big |\sqrt{c_{\rho }^{2}\rho ^{7}-4}\Big |>0.5164 \end{aligned}$$

and \(\big |(z^{m}-y_{1})-(z^{m}-y_{2})\big |=\Big |\sqrt{c_{\rho }^{2}\rho ^{2n-m}-4}\Big |\), we have that \(\big |z^{m}-y_{j}\big |\ge c_{2}/2\) for some \(j\in \{1,2\}\). If \(j=2\), then we divide both sides of the resulting inequality in (7.4) by \(|y_{1}|=1\) and we write \(y_{1}^{-1}=e^{i\zeta _{m-2n}}\) with \(\zeta _{m-2n} \in (0,2\pi )\), since the trinomial (7.3) has complex roots with modulus 1 for all \(m-2n\in \left[ -7,397\right] \), so that

$$\begin{aligned} \big |e^{i(m\theta +\zeta _{m-2n})}-1\big |<\frac{1.9}{\rho ^{m/2}}. \end{aligned}$$

Similar to the case of the reduction of n in the proof of Theorem 2.1, we succeed in transforming the above inequality to

$$\begin{aligned} |m\kappa -r+\mu _{m-2n}|<AB^{-m}, \end{aligned}$$
(7.9)

where now

and \(B:=\sqrt{\rho }\). Note that \(m<M:=5.2\times 10^{21}\), and we applied Lemma 5.1 to inequality (7.9) for each \(m-2n\in \left[ -7,397\right] \). This time, we find through a computational search that \(q_{45}=862020269673771307850593\) is the denominator of the first convergent of the continued fraction of \(\kappa \), such that \(q_{45}>6\,M\), \(\min \{\epsilon :m-2n \in \left[ -7,397\right] \}=\left\| \mu _{43} q_{45}\right\| -M\left\| \kappa q_{45}\right\| >1.28279\times 10^{-3}\) and the maximum value of \(\log (Aq_{45}/\epsilon )/\log B\) is \(<419.195\).

In any case we have shown the following result.

Lemma 7.3

All solutions (nm) of Eq. (2.2) are in the range \(n\le 213\) and \(m\le 419\).

By a computational search, we find that the only common values between \(P_{n}\) and \(\pm R_{-m}\) for \(m\in \left[ 0,419\right] \) and \(n\in \left[ 0,213\right] \) are those recorded in the statement of Theorem 2.2. The proof of Theorem 2.2 is now complete.

8 The Proof of Theorem 2.3

8.1 The Case \(m\ge n\)

Suppose that \(n\ge 18\) and \(m\ge 6\). Using (3.6) and (3.7) in Eq. (2.3), we have

$$\begin{aligned} \rho ^{\frac{m}{2}-3\times 10^{15}\log m}<|\pm R_{-m}|=|P_{-n}|<0.51\rho ^{n/2}. \end{aligned}$$

Taking logarithms in the resulting inequality above, we get

$$\begin{aligned} m-n<6\times 10^{15}\log m. \end{aligned}$$
(8.1)

Using now (3.1), (3.2), and (3.3) in Eq. (2.3) with \(\varepsilon :=\pm 1\), we get

$$\begin{aligned} c_{\beta }\rho ^{\frac{n}{2}}z^{-n}\bigg (\frac{\varepsilon \rho ^{\frac{m-n}{2}}z^{n-m}}{c_{\beta }}-1\bigg )+c_{\gamma }\rho ^{\frac{n}{2}}z^{n}\bigg (\frac{\varepsilon \rho ^{\frac{m-n}{2}}z^{m-n}}{c_{\gamma }}-1\bigg )=\frac{c_{\rho }}{\rho ^{n}}-\frac{\varepsilon }{\rho ^{m}}.\nonumber \\ \end{aligned}$$
(8.2)

Dividing the above equation by \(\rho ^{n/2}\) and taking absolute value, we obtain

$$\begin{aligned} \big |c_{\beta }z^{-n}\big (\varepsilon c_{\beta }^{-1}\rho ^{(m-n)/2}z^{n-m}-1\big )+c_{\gamma }z^{n}\big (\varepsilon c_{\gamma }^{-1}\rho ^{(m-n)/2}z^{m-n}-1\big )\big |<\frac{2}{\rho ^{3n/2}}, \end{aligned}$$

so

$$\begin{aligned} \Bigg |\frac{c_{\beta }}{c_{\gamma }}z^{-2n}\Bigg (\frac{1-\varepsilon c_{\beta }^{-1}\rho ^{(m-n)/2}z^{n-m}}{\varepsilon c_{\gamma }^{-1}\rho ^{(m-n)/2}z^{m-n}-1}\Bigg )-1\Bigg |<\frac{3}{\rho ^{3n/2}}, \end{aligned}$$
(8.3)

where we have used the fact that \(\big |c_{\gamma }z^{n}\big (\varepsilon c_{\gamma }^{-1}\rho ^{(m-n)/2}z^{m-n}-1\big )\big |\ge \big |\rho ^{(m-n)/2}-|c_{\gamma }|\big |\ge 1-|c_{\gamma }|\) for all \(m-n\ge 0\). We apply Theorem 4.1 with the parameters

$$\begin{aligned} \alpha _{1}:=\frac{c_{\beta }}{c_{\gamma }},\quad \alpha _{2}:=z^{2},\quad \alpha _{3}:=\frac{1-\varepsilon c_{\beta }^{-1}\rho ^{(m-n)/2}z^{n-m}}{\varepsilon c_{\gamma }^{-1}\rho ^{(m-n)/2}z^{m-n}-1},\quad b_{1}=b_{3}:= 1, \end{aligned}$$

and \(b_{2}:=-n\). We take \({\mathbb {K}}:= {\mathbb {Q}}\big (\sqrt{\rho },\beta \big )\), so \(D=12\). We also take \(B:=m\) since \(m\ge n\). Note that \(h(\alpha _{1})=h((c_{\gamma }/c_{\beta })^{-1})=h(c_{\gamma }/c_{\beta })\le \tfrac{2}{3}\log 23\), so \(A_{1}:= 8\log 23\) is a correct choice. We already knew that \(h(z)\le (\log \rho )/3\), so \(h(\alpha _{2})\le (2\log \rho )/3\) and we chose \(A_{2}=8\log \rho \). Now, let us estimate \(h(\alpha _{3})\). We have

$$\begin{aligned} h(\alpha _{3})&\le h\big (1-\varepsilon c_{\beta }^{-1}\rho ^{(m-n)/2}z^{n-m}\big )+h\big (\varepsilon c_{\gamma }^{-1}\rho ^{(m-n)/2}z^{m-n}-1\big )\\&\le |m-n|(h(\rho )+h(z^{2}))+2h(c_{\beta })+2\log 2\\&\le (m-n)\log \rho +\tfrac{2}{3}\log 23+2\log 2\\&<1.7\times 10^{15}\log m, \end{aligned}$$

where we have used (8.1) and the facts \(h(c_{\beta })=h(c_{\gamma })=(\log 23)/3\), \(h(\rho )=(\log \rho )/3\), and \(h\big (z^{2}\big )\le (2\log \rho )/3\). Therefore, we can take \(A_{3}:=2.04\times 10^{16}\log m\). Finally, let us prove that \(\Lambda _{5}:=\alpha _{1}^{b_{1}}\alpha _{2}^{b_{2}}\alpha _{3}^{b_{3}}-1\) is non-zero. Well, if it were, then

$$\begin{aligned} c_{\beta }\rho ^{\frac{n}{2}}z^{-n}\big (\varepsilon c_{\beta }^{-1}\rho ^{\frac{m-n}{2}}z^{n-m}-1\big )+c_{\gamma }\rho ^{\frac{n}{2}}z^{n}\big (\varepsilon c_{\gamma }^{-1}\rho ^{\frac{m-n}{2}}z^{m-n}-1\big )=0. \end{aligned}$$

This implies by (8.2) that \(c_{\rho }\rho ^{-n}-\varepsilon \rho ^{-m}=0\). From here, \(n-m=(\log c_{\rho })/\log \rho \), which is not possible. Thus, \(\Lambda _{5}\ne 0\). Now, Theorem 4.1 and the fact that \(1+\log (3\,m)<2.2\log m\) for all \(m\ge 6\) imply that

$$\begin{aligned} \exp \big (-1.707\times 10^{35}\log ^{2}m \big )<\Bigg |\frac{c_{\beta }}{c_{\gamma }}z^{-2n}\Bigg (\frac{1-\varepsilon c_{\beta }^{-1}\rho ^{\frac{(m-n)}{2}}z^{n-m}}{\varepsilon c_{\gamma }^{-1}\rho ^{\frac{(m-n)}{2}}z^{m-n}-1}\Bigg )-1\Bigg |.\nonumber \\ \end{aligned}$$
(8.4)

Combining (8.3) and (8.4), and then taking logarithms in the resulting inequality, we get

$$\begin{aligned} \tfrac{3n}{2}\log \rho -\log 3<1.707\times 10^{35}\log ^{2}m. \end{aligned}$$

From the above inequality, we have \(n<4.1\times 10^{35}\log ^{2}m\). Thus, by (8.1), one obtains that \(m<4.2\times 10^{35}\log ^{2}m\), which leads to \(m<3.48\times 10^{39}\). Let us record what we just proved.

Lemma 8.1

If (nm) is a solution of Eq. (2.3) with \(m\ge \max \{n,18\}\), then \(m<3.48\times 10^{39}\).

We begin with the reduction of the upper bound of \(m-n\). Combining (2.3), (7.6) and inequality \(|P_{-n}|<0.51\rho ^{n/2}\) for all \(n\ge 18\) (by (3.6)), and proceeding as in the reduction of \(m-2n\) in the proof of Theorem 2.2, we obtain

$$\begin{aligned} \bigg |\frac{\theta }{\pi }-\frac{r}{m}\bigg |<\frac{0.1}{m\rho ^{(m-n)/2}}, \end{aligned}$$
(8.5)

where . On using Lemma 5.2 with \(M:=3.48\times 10^{39}\), which is an upper bound for m by Lemma 8.1, we get the same inequality (7.8). By combining (7.8) and (8.5) and using Lemma 8.1, we get that

$$\begin{aligned} m-n<\frac{2\log \big (0.1 \cdot 3552\cdot 3.48\times 10^{39}\big )}{\log \rho }<689.336. \end{aligned}$$

Now, we find again an absolute upper bound for m using this absolute upper bound for \(m-n\). To do so, we repeat the procedure described after (8.1) and before Lemma 8.1. All parameters are the same except \(A_3\) which is now 2367. Thus, \(m<2.64\times 10^{24}\). By repeating the previous reduction for \(m-n\) with this new upper bound for m, we get that \(m-n\le 441\). Therefore, \(m-n\in \left[ 0,441\right] \). Next, we reduce the bound of m. Let

$$\begin{aligned} z^{\prime }:=\frac{1-\varepsilon c_{\beta }^{-1}\rho ^{(m-n)/2}z^{n-m}}{\varepsilon c_{\gamma }^{-1}\rho ^{(m-n)/2}z^{m-n}-1}. \end{aligned}$$

Note that \(z^{\prime }\) is a complex number with \(|z^{\prime }|=1\), since \(\overline{c_{\beta }}=c_{\gamma }\), \(z=\overline{z^{-1}}\), and \(\rho \in {\mathbb {R}}\). Thus, \(z^{\prime }=e^{i\varphi _{m-n}}\) with \(\varphi _{m-n}\in (0,2\pi )\) for each \(m-n \in \left[ 0,441\right] \). Then, (8.3) becomes

$$\begin{aligned} \big |e^{i(-2n\theta +\varphi _{m-n}-2\omega )}-1\big |<\frac{3}{\rho ^{3n/2}}. \end{aligned}$$

Similar to the case of the reduction of n in the proof of Theorem 2.1, using (6.9), we manage to convert the above inequality into

$$\begin{aligned} |n\kappa -r+\mu _{m-n}|<AB^{-m}, \end{aligned}$$
(8.6)

where now ,

$$\begin{aligned} \kappa :=-2\theta /\pi ,\quad \mu _{m-n}:=(\varphi _{m-n}-2\omega )/\pi ,\quad A:=1.5,\quad \text {and}\quad B:=\rho ^{3/2}. \end{aligned}$$

Note that \(n\le m<M:=2.64\times 10^{24}\). This time, applying Lemma 5.1 to inequality (8.6) for each \(m-n \in \left[ 0,441\right] \), we find computationally that \(q_{47}=3426387812500808051528229268\) is the denominator of the first convergent of the continued fraction of \(\kappa \), such that \(q_{47}>6M\), the minimum value of \(\epsilon \) is \(>3.6782\times 10^{-4}\) and the maximum value of \(\log (Aq_{47}/\epsilon )/\log B\) is \(<170.021\).

In short, we have showed the following.

Lemma 8.2

If (nm) is a solution of Eq. (2.3) with \(m\ge n\), then \(m\le 170\).

8.2 The Case \(n>m\)

Suppose that \(n\ge 18\) and \(m\ge 6\). Using (3.6) and (3.7) in Eq. (2.3) and taking logarithms in the resulting inequality, we obtain

$$\begin{aligned} n-m<2.6\times 10^{16}\log n. \end{aligned}$$
(8.7)

Using now (3.1), (3.2), and (3.3) in Eq. (2.3) with \(\varepsilon :=\pm 1\), we get

$$\begin{aligned} \rho ^{m/2}z^{-m}\big (c_{\beta }\rho ^{\frac{n-m}{2}}z^{m-n}-\varepsilon \big )+\rho ^{m/2}z^{m}\big (c_{\gamma }\rho ^{\frac{n-m}{2}}z^{n-m}-\varepsilon \big )=\varepsilon \rho ^{-m}-c_{\rho }\rho ^{-n}. \end{aligned}$$

Dividing the above equation by \(\rho ^{m/2}\) and taking absolute value, we obtain

$$\begin{aligned} \big |z^{-m}\big (c_{\beta }\rho ^{(n-m)/2}z^{m-n}-\varepsilon \big )+z^{m}\big (c_{\gamma }\rho ^{(n-m)/2}z^{n-m}-\varepsilon \big )\big |<\frac{2}{\rho ^{3m/2}}, \end{aligned}$$

so

$$\begin{aligned} \Bigg |z^{-2m}\Bigg (\frac{\varepsilon -c_{\beta }\rho ^{(n-m)/2}z^{m-n}}{c_{\gamma }\rho ^{(n-m)/2}z^{n-m}-\varepsilon }\Bigg )-1\Bigg |<\frac{1942}{\rho ^{3m/2}}, \end{aligned}$$
(8.8)

where we have used the fact that \(\big |c_{\gamma }\rho ^{(n-m)/2}z^{n-m}-\varepsilon \big |\ge \big ||c_{\gamma }|\rho ^{(n-m)/2}-1\big |\ge \big ||c_{\gamma }|\rho ^{5}-1\big |\) for all \(n-m>0\). We apply Theorem 4.1 with the parameters

$$\begin{aligned} \alpha _{1}:=z,\quad \alpha _{2}:=\frac{\varepsilon -c_{\beta }\rho ^{(n-m)/2}z^{m-n}}{c_{\gamma }\rho ^{(n-m)/2}z^{n-m}-\varepsilon },\quad b_{1}:=-2m,\quad \text {and}\quad b_{2}:=1. \end{aligned}$$

We take \({\mathbb {K}}:= {\mathbb {Q}}\big (\sqrt{\rho },\beta \big )\), so \(D=12\). We also take \(B:=2n\), since \(n>m\). We know that \(h(\alpha _{1})\le (\log \rho )/3\), so \(A_{1}:= 4\log \rho \) is a correct choice. On other hand, it can be seen that \(h(\alpha _{2})<(n-m)\log \rho +(2\log 23)/3+2\log 2\), using the facts \(h(c_{\beta })=h(c_{\gamma })=(\log 23)/3\), \(h(\rho )=(\log \rho )/3\), and \(h\big (z^{2}\big )\le (2\log \rho )/3\). Therefore, we can take \(A_{2}:=8.88\times 10^{16}\log n\) by (8.7). Now, Theorem 4.1 and the fact that \(1+\log (4n)<1.9\log n\) for all \(n\ge 18\) imply that

$$\begin{aligned} \exp \big (-8.76618\times 10^{31}\log ^{2}n \big )<\Bigg |z^{-2m}\Bigg (\frac{\varepsilon -c_{\beta }\rho ^{\frac{(n-m)}{2}}z^{m-n}}{c_{\gamma }\rho ^{\frac{(n-m)}{2}}z^{n-m}-\varepsilon }\Bigg )-1\Bigg |. \end{aligned}$$
(8.9)

Combining (8.8) and (8.9), and then taking logarithms in the resulting inequality, we obtain after some calculations using (8.7) the following result.

Lemma 8.3

If (nm) is a solution of Eq. (2.3) with \(n>\max \{m,6\}\), then \(n<1.52\times 10^{36}\).

We begin with the reduction of the upper bound of \(n-m\). Combining (2.3), (6.5) and inequality \(|R_{-m}|<2.01\rho ^{m/2}\) for all \(m\ge 6\) (by (3.7)), and proceeding as in the reduction of \(n-2m\) in the proof of Theorem 2.1, we obtain

$$\begin{aligned} \bigg |\frac{n\theta }{\pi }-r+\frac{\omega }{\pi }\bigg |<2.1\rho ^{-(n-m)/2}, \end{aligned}$$
(8.10)

where . We put \(M=1.52\times 10^{36}\), which is an upper bound for n by Lemma 8.3. It then follows from Lemma 5.1 applied to inequality (8.10) that:

$$\begin{aligned} n-m<\log (Aq_{69}/\epsilon )/\log B<625.594, \end{aligned}$$

where \(q_{69}=28053414776062526249173714612539009521\) is the denominator of the first convergent of the continued fraction of \(\theta /\pi \) such that \(q_{69}>6\,M\) and \(\epsilon >0.371861\). Now, we repeat the arguments used before Lemma 8.3 to find again an absolute upper bound for n with the help of the new upper bound we have for \(n-m\). In this reduction, we just change \(A_{2}\) to 2151 and get that \(n<2.4\times 10^{20}\). Now, we reduce again to \(n-m\) with the help of Lemma 5.1 taking into account that \(n<M=2.4\times 10^{20}\). In this application of Lemma 5.1, it suffices to take \(q_{37}=1788537343925558655409\) to satisfy that \(q_{37}>6\,M\), \(\epsilon >0.128786\) and we arrive at \(n-m\le 367\). Therefore, \(n-m \in \left[ 1,367\right] \).

Next we reduce the bound of n. Put

$$\begin{aligned} z^{\prime }:=\frac{\varepsilon -c_{\beta }\rho ^{(n-m)/2}z^{m-n}}{c_{\gamma }\rho ^{(n-m)/2}z^{n-m}-\varepsilon }. \end{aligned}$$

Note that \(z^{\prime }\in {\mathbb {C}}\) with \(|z^{\prime }|=1\), since \(\overline{c_{\beta }}=c_{\gamma }\), \(z=\overline{z^{-1}}\), and \(\rho \in {\mathbb {R}}\). Thus, \(z^{\prime }=e^{i\lambda _{m-n}}\) with \(\lambda _{m-n}\in (0,2\pi )\) for each \(n-m \in \left[ 1,367\right] \). Then, (8.8) becomes

$$\begin{aligned} \big |e^{i(-2m\theta +\lambda _{m-n})}-1\big |<\frac{1942}{\rho ^{3m/2}}. \end{aligned}$$

In a similar way as in the case of the reduction of n in the proof of Theorem 2.1, we manage to transform the previous inequality into

$$\begin{aligned} |m\kappa -r+\mu _{m-n}|<AB^{-n}, \end{aligned}$$
(8.11)

where now

$$\begin{aligned} \kappa :=-2\theta /\pi ,\quad \mu _{m-n}:=\lambda _{m-n}/\pi ,\quad A:=971,\quad \text {and}\quad B:=\rho ^{3/2}. \end{aligned}$$

Here, \(m<n<M:=2.4\times 10^{20}\). This time, applying Lemma 5.1 to inequality (8.11) for each \(n-m\in \left[ 1,367\right] \), we find computationally that \(q_{42}=62878052392513962537203\) is the denominator of the first convergent of the continued fraction of \(\kappa \), such that \(q_{42}>6M\), the minimum value of \(\epsilon \) is \(>1.18018\times 10^{-3}\) and the maximum value of \(\log (Aq_{42}/\epsilon )/\log B\) is 150.

In short, we have showed the following.

Lemma 8.4

If (nm) is a solution of Eq. (2.3) with \(n>m\), then \(n\le 150\).

From Lemmas 8.2 and 8.4, it is sufficient to look for coincidences between \(P_{-n}\) and \(\pm R_{-m}\) for \(\max \{n,m\}\le 170\). By means of a computational search, we find those given in Theorem 2.3. This ends the proof of Theorem 2.3.