# On the Problem of Pillai with Fibonacci numbers and powers of 3

Mahadi Ddamulira

► To cite this version:

Mahadi Ddamulira. On the Problem of Pillai with Fibonacci numbers and powers of 3. Boletín de la Sociedad Matematica Mexicana, 2020, 26 (3), pp.263-277. 10.1007/s40590-019-00263-1. hal-02013056v2

HAL Id: hal-02013056

https://hal.science/hal-02013056v2

Submitted on 22 Nov 2019

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
<figure><img src="image_2.png" /></figure>

# On a problem of Pillai with Fibonacci numbers and powers of 3

Mahadi Ddamulira<fnref n="1" />

Received: 18 April 2019 / Accepted: 10 September 2019
© The Author(s) 2019

## Abstract

Consider the sequence {$F_n$}$_{n \ge 0}$ of Fibonacci numbers defined by $F_0 = 0$, $F_1 = 1$, and $F_{n+2} = F_{n+1} + F_n$ for all $n \ge 0$. In this paper, we find all integers $c$ having at least two representations as a difference between a Fibonacci number and a power of 3.

**Keywords** Fibonacci numbers · Linear forms in logarithms · Baker's method

**Mathematics Subject Classification** 11B39 · 11J86

## 1 Introduction

We consider the sequence {$F_n$}$_{n \ge 0}$ of Fibonacci numbers defined by

$$F_0 = 0, F_1 = 1, \text{ and } F_{n+2} = F_{n+1} + F_n \text{ for all } n \ge 0.$$

The first few terms of the Fibonacci sequence are

$$\{F_n\}_{n \ge 0} = 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, \dots$$

In this paper, we are interested in studying the Diophantine equation

$$F_n - 3^m = c \qquad (1)$$

<footnote>The author was supported by the Austrian Science Fund (FWF) Projects: F5510-N26—Part of the special research program (SFB), “Quasi-Monte Carlo Methods: Theory and Applications”, P26114-N26—“Diophantine Problems: Analytic, geometric and computational aspects”, and W1230—“Doctoral Program Discrete Mathematics”.</footnote>

<footnote>✉ Mahadi Ddamulira
mddamulira@tugraz.at; mahadi@AIMS.edu.GH</footnote>

<footnote n="1">¹ Institute of Analysis and Number Theory, Graz University of Technology, Kopernikusgasse 24/II,
8010 Graz, Austria</footnote>
for a fixed integer $c$ and variable integers $n$ and $m$. In particular, we are interested in finding those integers $c$ admitting at least two representations as a difference between a Fibonacci number and a power of 3. This equation is a variant of the Pillai equation

$$a^x - b^y = c \qquad (2)$$

where $x, y$ are nonnegative integers and $a, b, c$ are fixed positive integers.

In 1936 and again in 1937, Pillai (see [16,17]) conjectured that for any given integer $c \ge 1$, the number of positive integer solutions $(a, b, x, y)$, with $x \ge 2$ and $y \ge 2$ to the Eq. (2) is finite. This conjecture is still open for all $c \ne 1$. The case $c = 1$ is Catalan's conjecture which was proved by Mihăilescu (see [15]). Pillai's work was an extension of the work of Herschfeld (see [12,13]), who had already studied a particular case of the problem with $(a, b) = (2, 3)$. Since then, different variants of the Pillai equation have been studied. Some recent results for the different variants of the Pillai problem involving Fibonacci numbers, Tribonacci numbers, Pell numbers and the $k$-generalized Fibonacci numbers with powers of 2 have been intensively studied in [3-7,10,11].

## 2 Main result

The main aim of this paper is to prove the following result. Since $F_1 = F_2 = 1$, we discard the situation when $n = 1$ and just count the solutions for $n = 2$.

**Theorem 1** The only integers $c$ having at least two representations of the form $F_n - 3^m$ are $c \in \{-26, -6, -1, 0, 2, 4, 7, 12\}$. Furthermore, all the representations of the above integers as $F_n - 3^m$ with integers $n \ge 2$ and $m \ge 0$ are given by

$$ 
\begin{aligned}
-26 &= F_{10} - 3^4 = F_2 - 3^3; \\
-6 &= F_8 - 3^3 = F_4 - 3^2; \\
-1 &= F_6 - 3^2 = F_3 - 3^1 \\
0 &= F_4 - 3^1 = F_2 - 3^0; \\
2 &= F_5 - 3^1 = F_4 - 3^0; \\
4 &= F_7 - 3^2 = F_5 - 3^0; \\
7 &= F_9 - 3^3 = F_6 - 3^0; \\
12 &= F_8 - 3^2 = F_7 - 3^0.
\end{aligned} 
\qquad (3) $$

## 3 Auxiliary results

To prove our main result Theorem 1, we need to use several times a Baker-type lower bound for a nonzero linear form in logarithms of algebraic numbers. There are many such in the literature like that of Baker and Wüstholz from [2]. We use the one of Matveev from [14]. Matveev [14] proved the following theorem, which is one of our main tools in this paper.
Let $\gamma$ be an algebraic number of degree $d$ with minimal primitive polynomial over the integers

$$a_0x^d + a_1x^{d-1} + \dots + a_d = a_0 \prod_{i=1}^{d} (x - \gamma^{(i)}),$$

where the leading coefficient $a_0$ is positive and the $\eta^{(i)}$'s are the conjugates of $\gamma$. Then, the logarithmic height of $\gamma$ is given by

$$h(\gamma) := \frac{1}{d} \left( \log a_0 + \sum_{i=1}^{d} \log \left( \max\{|\gamma^{(i)}|, 1\} \right) \right).$$

In particular, if $\gamma = p/q$ is a rational number with $\gcd(p, q) = 1$ and $q > 0$, then $h(\gamma) = \log \max\{|p|, q\}$. The following are some of the properties of the logarithmic height function $h(\cdot)$, which will be used in the next sections of this paper without reference:

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

**Theorem 2** (Matveev) Let $\gamma_1, \dots, \gamma_t$ be positive real algebraic numbers in a real algebraic number field $\mathbb{K}$ of degree $D$, $b_1, \dots, b_t$ be nonzero integers, and assume that

$$\Lambda := \gamma_1^{b_1} \cdots \gamma_t^{b_t} - 1, \quad (5)$$

is nonzero. Then

$$\log |\Lambda| > -1.4 \times 30^{t+3} \times t^{4.5} \times D^2(1 + \log D)(1 + \log B)A_1 \cdots A_t,$$

where

$$B \ge \max\{|b_1|, \dots, |b_t|\},$$

and

$$A_i \ge \max\{Dh(\gamma_i), |\log \gamma_i|, 0.16\}, \quad \text{for all } i = 1, \dots, t.$$

During the calculations, we get upper bounds on our variables which are too large; thus, we need to reduce them. To do so, we use some results from the theory of continued fractions.

For the treatment of linear forms homogeneous in two integer variables, we use the well-known classical result in the theory of Diophantine approximation.
**Lemma 1** Let $\tau$ be an irrational number, $\frac{p_0}{q_0}$, $\frac{p_1}{q_1}$, $\frac{p_2}{q_2}$, ..., be all the convergents of the continued fraction of $\tau$ and M be a positive integer. Let N be a nonnegative integer such that $q_N > M$. Then, putting $a(M) := \max\{a_i : i = 0, 1, 2, \dots, N\}$, the inequality

$$ \left| \tau - \frac{r}{s} \right| > \frac{1}{(a(M) + 2)s^2}, $$

holds for all pairs $(r, s)$ of positive integers with $0 < s < M$.

For a nonhomogeneous linear form in two integer variables, we use a slight variation of a result due to Dujella and Pethő (see [8], Lemma 5a), which is itself a generalization of the result of Baker and Davenport [1]. For a real number $X$, we write $||X|| := \min\{|X - n| : n \in \mathbb{Z}\}$ for the distance from $X$ to the nearest integer.

**Lemma 2** Let $M$ be a positive integer, $\frac{p_0}{q_0}$ be a convergent of the continued fraction of the irrational number $\tau$ such that $q > 6M$, and $A, B, \mu$ be some real numbers with $A > 0$ and $B > 1$. Let further $\varepsilon := ||\mu q|| - M||\tau q||$. If $\varepsilon > 0$, then there is no solution to the inequality

$$ 0 < |u\tau - v + \mu| < AB^{-w}, $$

in positive integers $u, v$, and $w$ with

$$ u \le M \quad \text{and} \quad w \ge \frac{\log(Aq/\varepsilon)}{\log B}. $$

Finally, the following lemma is also useful. It is Lemma 7 in [9].

**Lemma 3** (Gúzman, Luca) If $m \ge 1$, $T > (4m^2)^m$, and $T > x/(\log x)^m$, then

$$ x < 2^m T (\log T)^m. $$

## 4 Proof of Theorem 1

Assume that there exist nonnegative integers $n, m, n_1, m_1$ with $\min\{n, n_1\} \ge 2$ and $\min\{m, m_1\} \ge 0$ such that $(n, m) \ne (n_1, m_1)$, and

$$ F_n - 3^m = F_{n_1} - 3^{m_1}. $$

Without loss of generality, we can assume that $m \ge m_1$. If $m = m_1$, then $F_n = F_{n_1}$, so $(n, m) = (n_1, m_1)$, which gives a contradiction to our assumption. Thus, $m > m_1$. Since

$$ F_n - F_{n_1} = 3^m - 3^{m_1}, \quad (6) $$

and the right-hand side is positive, we get that the left-hand side is also positive and so $n > n_1$.
Using the Binet formula

$$F_k = \frac{\alpha^k - \beta^k}{\sqrt{5}} \quad \text{for all } k \ge 0, \qquad (7)$$

where $(\alpha, \beta) := (\frac{1+\sqrt{5}}{2}, \frac{1-\sqrt{5}}{2})$ are the roots of the equation $x^2 - x - 1 = 0$, which is the characteristic equation of the Fibonacci sequence. One can easily prove by induction that

$$\alpha^{k-2} \le F_n \le \alpha^{k-1} \quad \text{for all } k \ge 1. \qquad (8)$$

Using the Eq. (6), we get

$$\alpha^{n-4} \le F_{n-2} \le F_n - F_{n_1} = 3^m - 3^{m_1} < 3^m, \qquad (9)$$

$$\alpha^{n-1} \ge F_n \ge F_n - F_{n_1} = 3^m - 3^{m_1} \ge 3^{m-1}, \qquad (10)$$

from which we get that

$$1 + \left( \frac{\log 3}{\log \alpha} \right) (m-1) < n < \left( \frac{\log 3}{\log \alpha} \right) m + 4. \qquad (11)$$

If $n \le 300$, then $m \le 127$. We ran a *Mathematica* program for $2 \le n_1 < n \le 300$ and $0 \le m_1 < m \le 127$ and found only the solutions from the list (3). From now, we assume that $n > 300$ and from (11) we have that $m > 127$. Therefore, to solve the Diophantine Eq. (1), it suffices to find an upper bound for $n$.

## 4.1 Bounding $n$

By substituting the Binet formula (7) in the Diophantine Eq. (1), we get

$$\begin{aligned} \left| \frac{\alpha^n}{\sqrt{5}} - 3^m \right| &= \left| \frac{\beta^n}{\sqrt{5}} + \frac{\alpha^{n_1} - \beta^{n_1}}{\sqrt{5}} - 3^{m_1} \right| \le \frac{\alpha^{n_1} + 2}{\sqrt{5}} + 3^{m_1} \\ &\le \frac{2\alpha^{n_1}}{\sqrt{5}} + 3^{m_1} < 3 \max\{\alpha^{n_1}, 3^{m_1}\}. \end{aligned}$$

Multiplying through by $3^{-m}$, using the relation (9) and using the fact that $\alpha < 3$, we get

$$|(\sqrt{5})^{-1} \alpha^n 3^{-m} - 1| < 3 \max \left\{ \frac{\alpha^{n_1}}{3^m}, 3^{m_1-m} \right\} < \max \{ \alpha^{n_1-n+7}, 3^{m_1-m+1} \}. \quad (12)$$

For the left-hand side, we apply the result of Matveev, Theorem 2 with the following data:

$t = 3, \quad \gamma_1 = \sqrt{5}, \quad \gamma_2 = \alpha, \quad \gamma_3 = 3, \quad b_1 = -1, \quad b_2 = n, \quad b_3 = -m.$
Throughout we work with the field $K := \mathbb{Q}(\sqrt{5})$ with $D = 2$. Since $\max\{1, n, m\} \le 2n$, we take $B := 2n$. Furthermore, we take $A_1 := 2h(\gamma_1) = \log 5$, $A_2 := 2h(\gamma_2) = \log \alpha$, $A_3 := 2h(\gamma_1) = 2 \log 3$. We put

$$ \Lambda = (\sqrt{5})^{-1} \alpha^n 3^{-m} - 1. $$

First we check that $\Lambda \ne 0$, if it were, then $\alpha^{2n} \in \mathbb{Q}$, a contradiction. Thus, $\Lambda \ne 0$. Then, by Matveev's theorem, the left-hand side of (12) is bounded as

$$ \log |\Lambda| > -1.4 \cdot 30^6 \cdot 3^{4.5} \cdot 2^2 (1 + \log 2)(1 + \log 2n)(\log 5)(\log \alpha)(2 \log 3). $$

By comparing with (12), we get

$$ \min\{(n - n_1 - 7) \log \alpha, (m - m_1 - 1) \log 3\} < 1.66 \times 10^{12} (1 + \log 2n), $$

which gives

$$ \min\{(n - n_1) \log \alpha, (m - m_1) \log 3\} < 1.67 \times 10^{12} (1 + \log 2n). $$

Now, we split the argument into two cases.

**Case 1.** $\min\{(n - n_1) \log \alpha, (m - m_1) \log 3\} = (n - n_1) \log \alpha$.

In this case, we rewrite (6) as

$$ \left| \left( \frac{\alpha^n - \alpha^{n_1}}{\sqrt{5}} \right) - 3^m \right| = \left| \left( \frac{\beta^n - \beta^{n_1}}{\sqrt{5}} \right) - 3^{m_1} \right| < 1 + 3^{m_1} \le 3^{m_1+1}, $$

which implies

$$ \left| \left( \frac{\alpha^{n-n_1}-1}{\sqrt{5}} \right) \alpha^{n_1} 3^{-m} - 1 \right| < 3^{m_1-m+1}. \quad (13) $$

We put

$$ \Lambda_1 = \left( \frac{\alpha^{n-n_1}-1}{\sqrt{5}} \right) \alpha^{n_1} 3^{-m} - 1. $$

To see that $\Lambda_1 \ne 0$, for if $\Lambda_1 = 0$, then

$$ \alpha^n - \alpha^{n_1} = \sqrt{5} \cdot 3^m. $$

By conjugating the above relation in $K$, we get that

$$ \beta^n - \beta^{n_1} = -\sqrt{5} \cdot 3^m. $$

The absolute value of the left-hand side is at most $|\beta^n - \beta^{n_1}| \le |\beta|^n + |\beta|^{n_1} < 2$, while the absolute value of the right-hand side is at least $| - \sqrt{5} \cdot 3^m | \ge \sqrt{5} > 2$ for all $m > 127$, which is a contradiction.
We apply Theorem 2 on the left-hand side of (13) with the data

$$t = 3, \quad \gamma_1 = \frac{\alpha^{n-n_1} - 1}{\sqrt{5}}, \quad \gamma_2 = \alpha, \quad \gamma_3 = 3, \quad b_1 = 1, \quad b_2 = n_1, \quad b_3 = -m.$$

The minimal polynomial of $\gamma_1$ divides

$$5X^2 - 5F_{n-n_1}X - ((-1)^{n-n_1} + 1 - L_{n-n_1}),$$

where $\{L_k\}_{k \ge 0}$ is the Lucas companion sequence of the Fibonacci sequence given by $L_0 = 2$, $L_1 = 1$, $L_{k+2} = 2L_{k+1} + L_k$ for all $k \ge 0$, for which the Binet formula for its general term is given by

$$L_k = \alpha^k + \beta^k \quad \text{for all } k \ge 0.$$

Thus, we obtain

$$h(\gamma_1) \le \frac{1}{2} \left( \log 5 + \log \left( \frac{\alpha^{n-n_1} + 1}{\sqrt{5}} \right) \right) < \frac{1}{2} \log(2\sqrt{5}\alpha^{n-n_1}) \\ < \frac{1}{2}(n - n_1 + 2) \log \alpha < 8.4 \times 10^{11} (1 + \log 2n). \quad (14)$$

So, we can take $A_1 := 1.67 \times 10^{12}(1 + \log 2n)$. Furthermore, as before, we take $A_2 := \log \alpha$ and $A_3 := 2\log 3$. Finally, since $\max\{1, n_1, m\} \le 2n$, we can take $B := 2n$. Then, we get

$$\log |\Lambda_1| > -1.4 \cdot 30^6 \cdot 3^{4.5} \cdot 2^2 (1 + \log 2)(1 + \log 2n)(16.8 \times 10^{11}(1 + \log 2n)) \\ \times (\log \alpha)(2 \log 3).$$

Then,

$$\log |\Lambda_1| > -1.72 \times 10^{24}(1 + \log 2n)^2.$$

By comparing the above relation with (13), we get that

$$(m - m_1) \log 3 < 1.80 \times 10^{24} (1 + \log 2n)^2. \quad (15)$$

**Case 2.** $\min\{(n - n_1) \log \alpha, (m - m_1) \log 3\} = (m - m_1) \log 3$.
In this case, we rewrite (6) as

$$\left| \frac{\alpha^n}{\sqrt{5}} - (3^{m-m_1} - 1) \cdot 3^{m_1} \right| = \left| \frac{\beta^n + \alpha^{n_1} - \beta^{n_1}}{\sqrt{5}} \right| < \frac{\alpha^{n_1} + 2}{\sqrt{5}} < \alpha^{n_1},$$

which implies that
$$ \left| (\sqrt{5}(3^{m-m_1}-1))^{-1} \alpha^n 3^{-m_1} - 1 \right| < \frac{\alpha^{n_1}}{3^m - 3^{m_1}} \le \frac{3\alpha^{n_1}}{3^m} < 3\alpha^{n_1-n+4} < \alpha^{n_1-n+7}. \quad (16) $$

We put

$$ \Lambda_2 = (\sqrt{5}(3^{m-m_1}-1))^{-1} \alpha^n 3^{-m_1} - 1. $$

Clearly, $\Lambda_2 \neq 0$, for if $\Lambda_2 = 0$, then $\alpha^{2n} \in \mathbb{Q}$, which is a contradiction. We again apply Theorem 2 with the following data

$$ t = 3, \quad \gamma_1 = \sqrt{5}(3^{m-m_1}-1), \quad \gamma_2 = \alpha, \quad \gamma_3 = \alpha, \quad b_1 = -1, \quad b_2 = n, \quad b_3 = -m_1. $$

The minimal polynomial of $\gamma_1$ is $X^2 - 5(3^{m-m_1}-1)^2$. Thus,

$$ h(\gamma_1) = \log(\sqrt{5}(3^{m-m_1}-1)) < (m - m_1 + 1) \log 3 < 1.25 \times 10^{12} (1 + \log 2n). $$

So, we can take $A_1 := 2.5 \times 10^{12}(1+\log 2n)$. Further, as in the previous applications, we take $A_2 := \log \alpha$ and $A_3 := 2 \log 3$. Finally, since $\max\{1, n, m_1\} \le 2n$, we can take $B := 2n$. Then, we get

$$ \log |\Lambda_2| > -1.4 \cdot 30^6 \cdot 3^{4.5} \cdot 2^2 (1 + \log 2) (1 + \log 2n) (2.5 \times 10^{12} \\ \times (1 + \log 2n)) (\log \alpha) (2 \log 3). $$

Thus

$$ \log |A_2| > -2.56 \times 10^{24} (1 + \log 2n)^2. $$

Now, by comparing with (16), we get that

$$ (n - n_1) \log \alpha < 2.58 \times 10^{24} (1 + \log 2n)^2. \quad (17) $$

Therefore, in both Case 1 and Case 2, we have

$$ \begin{aligned} \min\{(n - n_1) \log \alpha, (m - m_1) \log 3\} &< 1.24 \times 10^{12} (1 + \log 2n), \\ \max\{(n - n_1) \log \alpha, (m - m_1) \log 3\} &< 2.58 \times 10^{24} (1 + \log 2n)^2. \end{aligned} \quad (18) $$

Finally, we rewrite the equation (6) as

$$ \left| \frac{(\alpha^{n-n_1}-1)}{\sqrt{5}} \alpha^{n_1} - (3^{m-m_1}-1) \cdot 3^{m_1} \right| = \left| \frac{\beta^n - \beta^{n_1}}{\sqrt{5}} \right| < |\beta|^{n_1} < 1. $$

Dividing through by $3^m - 3^{m_1}$, we get
$$ \left| \left( \frac{\alpha^{n-n_1}-1}{\sqrt{5}(3^{m}-3^{m_1}-1)} \right) \alpha^{n_1} 3^{-m_1} - 1 \right| < \frac{1}{(3^m - 3^{m_1})} \le \frac{3}{3^m} \\ \le 3\alpha^{-(n-4)} \le \alpha^{7-n}, \qquad (19) $$

since $\alpha < 3$ and $\alpha < \alpha^{n_1}$. We again apply Theorem 2 on the left-hand side of (19) with the data

$$ t = 3, \quad \gamma_1 = \frac{\alpha^{n-n_1}-1}{\sqrt{5}(3^{m}-3^{m_1}-1)}, \quad \gamma_2 = \alpha, \quad \gamma_3 = 3, \quad b_1 = 1, \quad b_2 = n_1, \quad b_3 = -m_1. $$

Using the algebraic properties of the logarithmic height function, we get

$$ h(\gamma_1) = h\left(\frac{\alpha^{n-n_1}-1}{\sqrt{5}(3^{m}-3^{m_1}-1)}\right) \le h\left(\frac{\alpha^{n-n_1}-1}{\sqrt{5}}\right) + h(3^{m}-3^{m_1}-1) \\ < \frac{1}{2}(n-n_1+4)\log\alpha + (m-m_1)\log 3 < 2.80 \times 10^{24}(1+\log 2n)^2, $$

where in the above inequalities, we used the argument from (14) as well as the bounds (18). Thus, we can take $A_1 := 5.60 \times 10^{24}(1+\log 2n)$, and again as before $A_2 := \log \alpha$ and $A_3 := 2 \log 3$. If we put

$$ \Lambda_3 = \left( \frac{\alpha^{n-n_1}-1}{\sqrt{5}(3^{m}-3^{m_1}-1)} \right) \alpha^{n_1} 3^{-m_1} - 1, $$

we need to show that $\Lambda_3 \neq 0$. If not, $\Lambda_3 = 0$ leads to

$$ \alpha^n - \alpha^{n_1} = \sqrt{5}(3^m - 3^{m_1}). $$

A contradiction is reached upon a conjugation in $\mathbb{K}$ and by taking absolute values on both sides. Thus, $\Lambda_3 \neq 0$. Applying Theorem 2 gives

$$ \log |\Lambda_3| > -1.4 \cdot 30^6 \cdot 3^{4.5} \cdot 2^2 (1 + \log 2) (1 + \log 2n) (5.6 \times 10^{24} (1 + \log 2n)^2) \\ \times (\log \alpha) (2 \log 3), $$

a comparison with (19) gives

$$ (n-4) < 3 \times 10^{36} (1 + \log 2n)^3, $$

or

$$ 2n < 6.2 \times 10^{36} (1 + \log 2n)^3. \qquad (20) $$

Now by applying Lemma 3 on (20) with the data $m = 3$, $T = 6.2 \times 10^{36}$, and $x = 2n$, leads to $n < 2 \times 10^{40}$.
## 4.2 Reducing the bound for $n$

We need to reduce the above bound for $n$ and to do so we make use of Lemma 2 several times. To begin, we return to (12) and put

$$ \Gamma := n \log \alpha - m \log 3 - \log(\sqrt{5}). $$

For technical reasons, we assume that $\min\{n - n_1, m - m_1\} \ge 20$. We go back to the inequalities for $\Lambda$, $\Lambda_1$, and $\Lambda_2$. Since we assume that $\min\{n - n_1, m - m_1\} \ge 20$ we get $|e^\Gamma - 1| = |\Lambda| < \frac{1}{4}$. Hence, $|\Lambda| < \frac{1}{2}$ and since the inequality $|y| < 2|e^y - 1|$ holds for all $y \in (-\frac{1}{2}, \frac{1}{2})$, we get

$$ |\Gamma| < 2 \max\{\alpha^{n_1-n+5}, 3^{m_1-m+1}\} \le \max\{\alpha^{n_1-n+8}, 3^{m_1-m+2}\}. $$

Assume that $\Gamma > 0$. We then have the inequality

$$ \begin{aligned} 0 < n \left( \frac{\log \alpha}{\log 3} \right) - m + \frac{\log(1/\sqrt{5})}{\log 3} &< \max \left\{ \frac{\alpha^8}{(\log 3)\alpha^{n-n_1}}, \frac{6}{(\log 3)3^{m-m_1}} \right\} \\ &< \max\{45\alpha^{-(n-n_1)}, 8 \cdot 3^{-(m-m_1)}\}. \end{aligned} $$

We apply Lemma 2 with the data

$$ \tau = \frac{\log \alpha}{\log 3}, \quad \mu = \frac{\log(1/\sqrt{5})}{\log 3}, \quad (A, B) = (45, \alpha) \text{ or } (8, 3). $$

Let $\tau = [a_0; a_1, a_2, \dots] = [0; 2, 3, 1, 1, 6, 1, 49, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 10, 3, \dots]$ be the continued fraction of $\tau$. We choose $M := 2 \times 10^{40}$ and consider the 91th convergent

$$ \frac{p}{q} = \frac{p_{91}}{q_{91}} = \frac{487624200385184167130255744232737921512174859336581}{1113251817385764505972408650620147577750763395186265}. $$

It satisfies $q = q_{91} > 6M$. Furthermore, it yields $\varepsilon > 0.4892$ and, therefore, either

$$ n - n_1 \le \frac{\log(45q/\varepsilon)}{\log \alpha} < 254, \quad \text{or} \quad m - m_1 \le \frac{\log(8q/\varepsilon)}{\log 3} < 110. $$

In the case $\Gamma < 0$, we consider the inequality

$$ \begin{aligned} m \left( \frac{\log 3}{\log \alpha} \right) - n + \frac{\log(\sqrt{5})}{\log \alpha} &< \max \left\{ \frac{\alpha^8}{\log \alpha} \alpha^{-(n-n_1)}, \frac{8}{\log \alpha} \cdot 3^{-(m-m_1)} \right\} \\ &< \max\{98\alpha^{-(n-n_1)}, 18 \cdot 3^{-(m-m_1)}\}. \end{aligned} $$
We then apply Lemma 2 with the data

$$ \tau = \frac{\log 3}{\log \alpha}, \quad \mu = \frac{\log \sqrt{5}}{\log \alpha}, \quad (A, B) = (98, \alpha), \quad \text{or} \quad (18, 3). $$

Let $\tau = [a_0; a_1, a_2, \dots] = [2; 3, 1, 1, 6, 1, 49, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 10, 3, 12, \dots]$ be the continued fraction of $\tau$. Again, we choose $M = 2 \times 10^{40}$, and in this case we consider the 101th convergent

$$ \frac{p}{q} = \frac{p_{101}}{q_{101}} = \frac{106360048375891410642967692492903700137161881169662}{56228858848524361385900581302251812795713192394033}, $$

which satisfies $q = q_{101} > 6M$. Further, this yields $\varepsilon > 0.125$ and, therefore, either

$$ n - n_1 \le \frac{\log(98q/\varepsilon)}{\log \alpha} < 254, \quad \text{or} \quad m - m_1 \le \frac{\log(18q/\varepsilon)}{\log 3} < 110. $$

These bounds agree with the bounds obtained in the case $\Gamma > 0$. As a conclusion, we have that either $n - n_1 \le 253$ or $m - m_1 \le 109$ whenever $\Gamma \ne 0$.

Now, we distinguish between the cases $n - n_1 \le 253$ and $m - m_1 \le 109$. First, we assume that $n - n_1 \le 253$. In this case, we consider the inequality for $\Lambda_1$, (13) and also assume that $m - m_1 \le 20$. We put

$$ \Gamma_1 = n_1 \log \alpha - m \log 3 + \log \left( \frac{\alpha^{n-n_1}}{\sqrt{5}} \right). $$

Then, the inequality (13) implies that

$$ |\Gamma_1| < \frac{6}{3^{m-m_1}}. $$

If we further assume that $\Gamma_1 > 0$, we then get

$$ 0 < n_1 \left( \frac{\log \alpha}{\log 3} \right) - m + \frac{\log((\alpha^{n-n_1} - 1)/\sqrt{5})}{\log 3} < \frac{6}{(\log 3)3^{m-m_1}} < \frac{6}{3^{m-m_1}}. $$

Again we apply Lemma 2 with the same $\tau$ as in the case $\Gamma > 0$. We use the 91th convergent $p/q = p_{91}/q_{91}$ of $\tau$ as before. But in this case, we choose $(A, B) := (8, 3)$ and use

$$ \mu_l = \frac{\log((\alpha^l - 1)/\sqrt{5})}{\log 3}, $$

instead of $\mu$ for each possible value of $l := n - n_1 \in [1, 2, \dots, 253]$. We have problems at $l \in \{4, 12\}$. We discard these values for now and we will treat them later. For the remaining values of $l$, we get $\varepsilon > 0.0005$. Hence by Lemma 2, we get
$$m - m_1 < \frac{\log(8q/0.0005)}{\log 3} < 116.$$

Thus, $n - n_1 \le 253$ implies that $m - m_1 \le 115$, unless $n - n_1 \in \{4, 12\}$. A similar conclusion is reached when $\Gamma_1 < 0$ with the same two exceptions for $n - n_1 \in \{4, 12\}$. The reason we have a problem at $l \in \{4, 12\}$ is because

$$\frac{\alpha^4 - 1}{\sqrt{5}} = \alpha^2, \quad \text{and} \quad \frac{\alpha^{12} - 1}{\sqrt{5}} = 2^3 \alpha^6.$$

So, $\Gamma_1 = (n_1 + 2) \log \alpha - m \log 3$, or $(n_1 + 6) \log \alpha - (m - 3) \log 3$ when $l = 4, 12$, respectively. Thus we get that

$$\left|\tau - \frac{m}{n_1 + 2}\right| < \frac{6}{3^{m-m_1}(n_1+2)}, \quad \text{or} \quad \left|\tau - \frac{m-3}{n_1+6}\right| < \frac{6}{3^{m-m_1}(n_1+6)},$$

respectively. We assume that $m - m_1 > 150$. Then, $3^{m-m_1} > 8 \times (4 \times 10^{40}) > 8 \times (n_1 + 6)$; therefore

$$\frac{6}{3^{m-m_1}(n_1+2)} < \frac{1}{3(n_1+2)^2}, \quad \text{and} \quad \frac{6}{3^{m-m_1}(n_1+6)} < \frac{1}{3(n_1+6)^2}.$$

By Lemma 1, it follows that $m/(n_1 + 2)$ or $(m - 3)/(n_1 + 6)$ are convergents of $\tau$, respectively. So, say one of $m/(n_1 + 2)$ or $(m - 3)/(n_1 + 6)$ is of the form $p_k/q_k$ for some $k = 0, 1, 2, \dots, 92$. Here, we use that $q_{92} > 4 \times 10^{40} > n + 1 + 6$. Then

$$\frac{1}{(a_k + 2)q_k^2} < \left|\tau - \frac{p_k}{q_k}\right|.$$

Since $\max\{a_k : k = 0, 1, 2, \dots, 92\} = 140$, we get

$$\frac{1}{142q_k^2} < \frac{6}{3^{m-m_1}q_k} \quad \text{and} \quad q_k \text{ divides one of } \{n_1 + 2, n_1 + 6\}.$$

Thus, we get

$$3^{m-m_1} \le 6 \times 142(n_1+6) < 6 \times 142 \times 4 \times 10^{40},$$

giving $m - m_1 \le 92$.

Now let us turn to the case $m - m_1 \le 109$ and we consider the inequality for $\Lambda_2$, (16). We put

$$\Gamma_2 = n \log \alpha - m_1 \log 3 + \log(1/(\sqrt{5}(3^{m-m_1} - 1))),$$
and we also assume that $n - n_1 \ge 20$. We then have

$$|\Gamma_2| < \frac{2\alpha^8}{\alpha^{n-n_1}}.$$

We assume that $\Gamma_2$, then we get

$$0 < n \left( \frac{\log \alpha}{\log 3} \right) - m_1 + \frac{\log(1/(\sqrt{5}(3^{m-m_1}-1)))}{\log \alpha} < \frac{3\alpha^8}{(\log 3)\alpha^{n-n_1}} < \frac{130}{\alpha^{n-n_1}}.$$

We apply again Lemma 2 with the same $\tau$, $q$, $M$, $(A, B) := (130, \alpha)$ and

$$\mu_l = \frac{\log(1/(\sqrt{5}(3^l - 1))))}{\log 3} \quad \text{for } k = 1, 2, \dots, 109.$$

We get $\varepsilon > 0.004$; therefore

$$n - n_1 < \frac{\log(130q/\varepsilon)}{\log \alpha} < 266.$$

A similar conclusion is reached when $\Gamma_2 < 0$. To conclude, we first get that either $n - n_1 \le 253$ or $m - m_1 \le 109$. If $n - n_1 \le 253$, then $m - m_1 \le 115$, and if $m - m_1 \le 109$ then $n - n_1 \le 265$. Thus, we conclude that we always have $n - n_1 \le 265$ and $m - m_1 \le 115$.

Finally, we go to the inequality of $\Lambda_3$, (19). We put

$$\Gamma_3 = n_1 \log \alpha - m_1 \log 3 + \log \left( \frac{\alpha^{n-n_1}-1}{\sqrt{5}(3^{m-m_1}-1)} \right).$$

Since $n \ge 300$, the inequality (19) implies that

$$|\Gamma_3| < \frac{3}{\alpha^{n-4}} = \frac{3\alpha^4}{\alpha^n}.$$

Assuming that $\Gamma_3 > 0$, then

$$0 < n_1 \left( \frac{\log \alpha}{\log 3} \right) - m_1 + \frac{\log((\alpha^k - 1)/(\sqrt{5}(3^l - 1)))}{\log 3} < \frac{3\alpha^4}{(\log 3)\alpha^n} < \frac{20}{\alpha^n},$$

where $(k, l) := (n - n_1, m - m_1)$. We again apply Lemma 2 with the same $\tau$, $q$, $M$, $(A, B) := (20, \alpha)$ and

$$\mu_{k,l} = \frac{\log((\alpha^k - 1)/(\sqrt{5}(3^l - 1)))}{\log 3} \quad \text{for } 1 \le k \le 265, \ 1 \le l \le 115.$$
As before, we have a problem at $(k, l) := (4, 1)$, $(12, 1)$, $(8, 2)$. The cases $(k, l) := (4, 1)$, $(12, 1)$ were treated before in the case of $\Gamma_1$. The case $(k, l) := (8, 2)$ arises because

$$ \frac{\alpha^8 - 1}{\sqrt{5}(3^2 - 1)} = \frac{3}{8}\alpha^4. $$

We, therefore, discard the cases $(k, l) := (4, 1)$, $(12, 1)$, $(8, 2)$ for some time. For the remaining cases, we get $\varepsilon > 0.0015$, so we obtain

$$ n \le \frac{\log(20q/\varepsilon)}{\log \alpha} < 264. $$

A similar conclusion is reached when $\Gamma_3 < 0$. Hence, $n < 300$. Now, we look at the cases $(k, l) := (4, 1)$, $(12, 1)$, $(8, 2)$. The cases $(k, l) := (4, 1)$, $(12, 1)$ can be treated as before when we showed that $n - n_1 \le 263$ implies $m - m_1 \le 115$. The case when $(k, l) = (8, 2)$ can be dealt with in a similar way. Namely, it gives that

$$ |(n_1 + 4)\tau - m_1| < \frac{20}{\alpha^n}. $$

Therefore

$$ \left| \tau - \frac{m_1}{n_1 + 4} \right| < \frac{20}{(n_1 + 4)\alpha^n}. \qquad (21) $$

Since $n \ge 300$, we have $\alpha^n > 2 \times 20 \times (4 \times 10^{40}) > 40(n_1 + 4)$. This shows that the right-hand side of the above inequality (21) is at most $2/(n_1 + 4)^2$. By Lemma 1, we get that $m_1/(n_1 + 4) = p_k/q_k$ for some $k = 1, 2, \dots, 92$. We then get by a similar argument as before that

$$ \alpha^n < 20 \times 142 \times (4 \times 10^{40}), $$

which gives $n \le 211$. Therefore, the conclusion is that $n < 300$ holds also in the case $(k, l) = (8, 2)$. However, this contradicts our working assumption that $n > 300$. This completes the proof of Theorem 1.

**Acknowledgements** Open access funding provided by Graz University of Technology. The author thanks the referee like to thank referee for the careful reading of the manuscript and the useful comments that greatly improved the quality of this paper. The research was supported by the Austrian Science Fund (FWF) Projects: F5510-N26—Part of the special research program (SFB), “Quasi-Monte Carlo Methods: Theory and Applications”, P26114-N26—“Diophantine Problems: Analytic, geometric and computational aspects”, and W1230—“Doctoral Program Discrete Mathematics”. The author also thanks his supervisor Professor Robert Tichy for support and encouragement.

**Open Access** This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.
## References

1. Baker, A., Davenport, H.: The equations $3x^2 - 2 = y^2$ and $8x^2 - 7 = z^2$. Q. J. Math. **20**(1), 129–137 (1969)

2. Baker, A., Wüstholz, G.: Logarithmic forms and Diophantine Geometry, vol. 9. Cambridge University Press, Cambridge (2008)

3. Bravo, J.J., Luca, F., Yazán, K.: On a problem of Pillai with Tribonacci numbers and powers of 2. Bull. Korean Math. Soc. **54**(3), 1069–1080 (2017)

4. Chim, K.C., Pink, I., Ziegler, V.: On a variant of Pillai's problem. Int. J. Number Theory **13**(7), 1711–1727 (2017)

5. Chim, K.C., Pink, I., Ziegler, V.: On a variant of Pillai's problem II. J. Number Theory **183**, 269–290 (2018)

6. Ddamulira, M., Luca, F., Rakotomalala, M.: On a problem of Pillai with Fibonacci numbers and powers of 2. Proc. Indian Acad. Sci. Math. Sci. **127**(3), 411–421 (2017)

7. Ddamulira, M., Gómez-Ruiz, C.A., Luca, F.: On a problem of Pillai with *k*-generalized Fibonacci numbers and powers of 2. Monatsh. Math. **187**(4), 635–664 (2018)

8. Dujella, A., Pethő, A.: A generalization of a theorem of Baker and Davenport. Q. J. Math. **49**(195), 291–306 (1998)

9. Gúzman Sánchez, S., Luca, F.: Linear combinations of factorials and *s*-units in a binary recurrence sequence. Ann. Math. Québec. **38**(2), 169–188 (2014)

10. Hernane, M.O., Luca, F., Rihane, S.E., Togbé, A.: On Pillai's problem with Pell numbers and powers of 2. Hardy-Ramanujan J. **41**, 22–31 (2018)

11. Hernández, S.H., Luca, F., Rivera, L.M.: On Pillai's problem with the Fibonacci and Pell sequences. Boletín de la Sociedad Matemática Mexicana (To appear)

12. Herschfeld, A.: The equation $2^x - 3^y = d$. Bull. Am. Math. Soc. **41**, 631 (1935)

13. Herschfeld, A.: The equation $2^x - 3^y = d$. Bull. Am. Math. Soc. **42**, 231–234 (1936)

14. Matveev, E.M.: An explicit lower bound for a homogeneous rational linear form in the logarithms of algebraic numbers, II, Izv. Ross. Akad. Nauk Ser. Mat. **64**(6), 125–180 (2000), in Russian; English translation in Izv. Math. **64**(6):1217–1269 (2000)

15. Mihăilescu, P.: Primary cyclotomic units and a proof of Catalan's conjecture. J. Reine Angew. Math. (Crelles J.) **572**, 167–195 (2006)

16. Pillai, S.S.: On $a^x - b^y = c$. J. Indian Math. Soc. (N.S.) **2**, 119–122 (1936)

17. Pillai, S.S.: A correction to the paper on $a^x - b^y = c$. J. Indian Math. Soc. (N.S.) **2**, 215 (1937)