# How many answers to $|3^x-2^y|=5$?

How many answers are there to the equation $|3^x-2^y|=5$ such that $x$ and $y$ are positive integers? Are there infinite? I've found $(2,2)$, $(3,5)$, and $(1,3)$. It seems to explode with larger values, but it's not a steady increase and there seems to be many dips. Do we KNOW that there are no large values for $x$ and $y$ where a power of 3 comes close to a power of 2?

• Its a putnam problem . Feb 5, 2016 at 23:12
• Kf-Sansoo, had to google "putnam problem." Do you mean literally one, or one that fits the general qualifications? Do I need to add a tag? If it is one that's been mentioned before, could you give a link? Feb 5, 2016 at 23:18
• Feb 6, 2016 at 0:01
• @Kf-Sansoo: so what? Does that mean the question shouldn't be discussed on MSE? Does it mean that there is helpful information about the question to be found elsewhere? Or what? Feb 6, 2016 at 0:01
• @Lucian: So, as it's conjectured that $Ax^n-By^m=C$ has a finite # of solutions for $(x,y,n,m)$ then $3^n-2^m=5$ can be conjectured to also have a finite # or solutions for $(n,m)$? In other words, it's unproven in a more general sense, so with the greater constraints it should be even less likely? If there are finite answers, my question could then be rephrased, "Is there a 4th answer?" Feb 6, 2016 at 0:18

There are only a finite number of solutions. It was proved by Pillai that $a^x - b^y = k$ where $a,b,k$ are fixed positive integers, $a > 1, b > 1, k \neq 0,$ with positive integer variables $x,y,$ has finitely many solutions. This is from page 51 in Shorey and Tijdeman, Exponential Diophantine Equations. The two papers by Pillai are 1931 and 1936. Both are in the Journal of the Indian Mathematical Society. A detail: if $k$ is larger than some bound that depends on $a,b,$ there is only one solution. Since we have more than one solution for $k = -5,$ it appears Pillai's bound is not tight enough to finish this problem. We just know one solution for $k=5.$

• I'll probably end up going with this as best answer. I've got an addendum though for your perusal, if I may. Since $|3^x-2^y|=5$ is proven to have finite solutions, I'd like to carry this knowledge to similar problems: i.e. $|(3^x)(5^y)-2^z|=7$, $|(2^x)(3^y)-5^z|=7$, $|(2^x)(3^y)-5^z|=7$. Namely working my way up to prime solutions such as $|(2^r)(7^s)(11^t)(13^u)(23^v)-(3^w)(5^x)(17^y)(19^z)|=29$ (or similarly creating primes less than the square of the largest prime used; in this case 23). Any thoughts? Probably throw this out there as a new ?. Feb 8, 2016 at 22:39

Here's an elementary self-contained argument that there is no solution with $y>5$.

A power of $3$ is congruent to either $1$ or $3 \bmod 8$, so once $y \geq 3$ we must have $3^x - 2^y = -5$.

Once $y \geq 6$, we then have $3^x \equiv -5 \bmod 2^6$, and thus $x \equiv 11 \bmod 16$.

But then $3^x + 5 \equiv 12 \bmod 17$, and no power of $2$ is congruent to $12 \bmod 17$ (the powers of $2 \bmod 17$ are $2,4,8,-1,-2,-4,-8,1,2,4,8,-1$ etc.), QED.

There is a large literature on such Diophantine questions. One key phrase is "$S$-unit equations". In general it has been known for some time that there are finitely many solutions, and indeed for equations of the form $$\prod_i p_i^{n_i} - \prod_j q_j^{m_j} = r$$ this already follows from Thue's theorem (1909); and by now we even have effective algorithms known to find all solutions. There's still no elementary technique known in general, but in your case (where only the primes 2,3,5) appear an elementary solution is contained in a 1976 paper
This is not a complete answer, but I'd just like to note a connection with the concept of irrationality measure. First recall that $\alpha \in \mathbf{R}$ has irrationality measure $\mu(\alpha)$ if, for all $r>\mu(\alpha)$, there are only finitely many pairs of integers $p,q$ such that $$\left| \alpha - \frac{p}{q} \right| < \frac{1}{q^r}.$$ Note that $\mu(\alpha)=\infty$ is allowed (but we have $\mu(\alpha)=2$ for all but a measure-zero set of reals $\alpha$).
With this definition out of the way, note that $$\left| 3^x - 2^y \right| = 5$$ implies $$3^x = 2^y \pm 5.$$ Take logs: $$\log(3^x) = \log(2^y) + \log(1 \pm 5 \cdot 2^{-y}).$$ So by the Taylor expansion of $\log(1+t)$, $$\left| \log(3^x) - \log(2^y) \right| < 5 \cdot 2^{-y}+\frac{5^2 \cdot 2^{-2y}}{2}+\cdots < 6 \cdot 2^{-y}$$ for $y$ sufficiently large. Hence, using $\log(3^x) = x \log 3$ and $\log(2^y) = y \log 2$ $$\left| \frac{\log 3}{\log 2} - \frac{y}{x} \right| < \frac{6}{x \log 2} \cdot 2^{-y}.$$ Since the RHS decreases much faster than anything polynomial in $x$ (at least for $y/x$ within some fixed small interval around $\log(3)/\log(2)$), the existence of infinitely many solutions to your equation would imply that $\mu(\log(3)/\log(2))$ were infinite. It is probably known that this latter statement is false, probably by methods similar to the proof in the Shorey/Tijdeman book mentioned by Will Jagy.