Elementary solution of exponential Diophantine equation $2^x - 3^y = 7$.

Looking at the equation modulo $ 3 $ gives that $ 2^x \equiv 1 \pmod{3} $ unless $ y = 0 $, hence $ x $ is even. On the other hand, modulo $ 7 $ we have $ 2^x \equiv 3^y \pmod{7} $, and since $ 2 \equiv 3^2 \pmod{7} $ and $ 3 $ is a primitive root modulo $ 7 $, this implies that $ 2x - y $ is divisible by $ 6 $, and hence $ y $ is even also. Writing $ x = 2m $ and $ y = 2n $, we find

$$ 2^{2m} - 3^{2n} = (2^m - 3^n)(2^m + 3^n) = 7 $$

Now, we use the primality of $ 7 $, and it is easily seen that the only solution is $ m = 2, n = 1 $. If $ y = 0 $, then obviously $ x = 3 $, so the only solutions are $ (4, 2) $ and $ (3, 0) $.


Compare Exponential Diophantine equation $7^y + 2 = 3^x$ answer by @Gyumin Roh

I made up a variant problem in comments. It seems that this method, posted by a Korean high school student, allows for such variations. $$ 2^u - 3^v = 5 $$ We see $8-3=5$ and $32-27 = 5.$ I did not get very far working around the solution $8-3,$ but $32 - 27$ was productive. I had to use one large prime, where finding the orders of $2,3 \pmod p$ would be prohibitive by hand. Nevertheless, these can be checked. Maybe I will be able to find a smaller string of primes. In this first version, I used $41, 31, 4561, 17.$

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

FIRST VERSION:

$$ 2^u = 3^v + 5 $$ $$ 2^u - 32 = 3^v - 27 $$ Apparently I turned it around. $$ 3^v - 27 = 2^u - 32. $$ With $v \geq 4$ and $u \geq 6,$ $$ 27 ( 3^x - 1) = 32 ( 2^y - 1)$$ with $x,y \geq 1,$ so that $3^x - 1 > 0$ and $2^y - 1 > 0.$ What we want to do is show that $3^x - 1$ is divisible by $64,$ because that will contradict the given factorization $32 \cdot \mbox{ODD}.$ In turn, this will contradict the existence of such an additional solution beyond those we knew.

Here we go, $$ 3^x \equiv 1 \pmod{32}. $$ This means that $8 | x.$ We factor, in hopes of finding useful new primes. $$ 3^8 - 1 = 32 \cdot 5 \cdot 41. $$ We use $41.$ Note that $8|x,$ so that $(3^8 - 1)| (3^x - 1)$ and so $41 | (3^x - 1).$ Therefore $41 |(2^y - 1).$

$$ 2^y \equiv 1 \pmod{41}. $$ This means that $20 | y.$ We factor, in hopes of finding useful new primes. $$ 2^{20} - 1 = 3 \cdot 5^2 \cdot 11 \cdot 31 \cdot 41. $$ We use $31$ now, with $31 |(3^x - 1).$

$$ 3^x \equiv 1 \pmod{31}. $$ This means that $30 | x.$ We factor, in hopes of finding useful new primes. $$ 3^{30} - 1 = 8 \cdot 7 \cdot 11^2 \cdot 13 \cdot 31 \cdot 61 \cdot 271 \cdot 4561. $$ We use $4561.$ We get $4561 |(2^y - 1).$ Sorry about that. I will look for a smaller string of primes later.

$$ 2^y \equiv 1 \pmod{4561}. $$ This means that $2280 | y,$ in particular $8|y.$ $$ 2^{8} - 1 = 3 \cdot 5 \cdot 17 . $$ We use $17$ now. Therefore $17 |(3^x - 1).$

$$ 3^x \equiv 1 \pmod{17}. $$ This means that $16 | x.$ $$ 3^{16} - 1 = 64 \cdot 5 \cdot 17 \cdot 41 \cdot 193 . $$

As I said, $64 | (3^{16} - 1)| (3^x-1)$ contradicts $ 27 ( 3^x - 1) = 32 ( 2^y - 1)$ with $3^x - 1 > 0$ and $2^y - 1 > 0.$

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

SECOND VERSION: I used $41, 31, 241, 17.$

$$ 27 ( 3^x - 1) = 32 ( 2^y - 1)$$ with $x,y \geq 1,$ so that $3^x - 1 > 0$ and $2^y - 1 > 0.$ What we want to do is show that $3^x - 1$ is divisible by $64,$ because that will contradict the given factorization $32 \cdot \mbox{ODD}.$ In turn, this will contradict the existence of such an additional solution beyond those we knew.

Here we go, $$ 3^x \equiv 1 \pmod{32}. $$ This means that $8 | x.$ We factor, in hopes of finding useful new primes. $$ 3^8 - 1 = 32 \cdot 5 \cdot 41. $$ We use $41.$ Note that $8|x,$ so that $(3^8 - 1)| (3^x - 1)$ and so $41 | (3^x - 1).$ Therefore $41 |(2^y - 1).$

$$ 2^y \equiv 1 \pmod{41}. $$ This means that $20 | y.$ We factor, in hopes of finding useful new primes. $$ 2^{20} - 1 = 3 \cdot 5^2 \cdot 11 \cdot 31 \cdot 41. $$ We use $31$ now, with $31 |(3^x - 1).$

$$ 3^x \equiv 1 \pmod{31}. $$ This means that $30 | x.$ However, we already knew that $8 | x,$ so $120|x.$ We factor, in hopes of finding useful new primes. $$ 3^{120} - 1 = 32 \cdot 5^2 \cdot 7 \cdot 11^2 \cdot 13 \cdot 31 \cdot 41 \cdot 61 \cdot 241 \cdot 271 \cdot 1181 \cdot 4561 \cdot 6481 \cdot \mbox{FOUR BIG}. $$ We use $241.$ We get $241 |(2^y - 1).$ I checked as to where it occurs, $241$ is the smallest prime factor of $3^{40} - 3^{20} + 1.$ Note that $( t^{40} - t^{20} + 1) =(t^8 - t^4 + 1)(t^{32} + t^{28} - t^{20} - t^{16} - t^{12} + t^4 + 1)$ was predictable based on the complex cube roots of $-1,$ however $241$ divides the less pleasant polynomial factor, in context $3^{32} + 3^{28} - 3^{20} - 3^{16} - 3^{12} + 3^4 + 1= 241 \cdot 298801 \cdot 26050081.$ Go Figure.

$$ 2^y \equiv 1 \pmod{241}. $$ This means that $24 | y,$ in particular $8|y.$ $$ 2^{8} - 1 = 3 \cdot 5 \cdot 17 . $$ We use $17$ now. Therefore $17 |(3^x - 1).$

$$ 3^x \equiv 1 \pmod{17}. $$ This means that $16 | x.$ $$ 3^{16} - 1 = 64 \cdot 5 \cdot 17 \cdot 41 \cdot 193 . $$

As I said, $64 | (3^{16} - 1)| (3^x-1)$ contradicts $ 27 ( 3^x - 1) = 32 ( 2^y - 1)$ with $3^x - 1 > 0$ and $2^y - 1 > 0.$