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

Solution 1:

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) $.

Solution 2:

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.$

Solution 3:

Tuesday, 27 September

Getting better at this. I found that gp-pari was taking too long. I wrote three easy C++ programs. One quickly find the order of a prime mod some other number, which is allowed to be composite. The second gives the prime factors of a big number $p^n - 1$ up to a bound. The third program is illustrated, with output, in the $\tiny 2^u - 3^v = 13$ answer.

Solving $$ 3^u - 5^v = 2. $$ We know the solution $27 - 25 = 2$ and suspect this is the largest. $$ 3^u - 27 = 5^v - 25. $$ $$ 27 ( 3^x - 1) = 25 ( 5^y - 1). $$ In case $x,y \geq 1:$

Given from 3: $$ 3^x \equiv 1 \pmod {25} \Longrightarrow 20 | x $$ $$ 3^{20} - 1 = 2^4 \cdot 5^2 \cdot 11^2 \cdot 61 \cdot 1181 $$

Given from 5: $$ 5^y \equiv 1 \pmod {27} \Longrightarrow 18 | y \Longrightarrow 3 | y $$ $$ 5^{18} - 1 = 2^3 \cdot 3^3 \cdot 7 \cdot 19 \cdot 31 \cdot 829 \cdot 5167 $$ We ignore these.

Using $1181.$ $$ 5^y \equiv 1 \pmod {1181} \Longrightarrow 590 | y \Longrightarrow 10 | y $$ $$ 5^{10} - 1 = 2^3 \cdot 3 \cdot 11 \cdot 71 \cdot 521 $$

Using $521.$ $$ 3^x \equiv 1 \pmod {521} \Longrightarrow 520 | x \Longrightarrow 8 | x $$ $$ 3^{8} - 1 = 2^5 \cdot 5 \cdot 41 $$

Using $41.$ $$ 5^y \equiv 1 \pmod {41} \Longrightarrow 20 | y \Longrightarrow 4 | y \Longrightarrow 12 | y $$ $$ 5^{12} - 1 = 2^4 \cdot 3^2 \cdot 7 \cdot 13 \cdot 31 \cdot 601 $$

Using $601.$ $$ 3^x \equiv 1 \pmod {601} \Longrightarrow 75 | x \Longrightarrow 25 | x \Longrightarrow 100 | x $$ $$ 3^{100} - 1 = 2^4 \cdot 5^3 \cdot 11^2 \cdot 61 \cdot 101 \cdot 151 \cdot 1181 \cdot \mbox{MORE} $$ That is, $$ 125 | (3^x - 1). $$ This contradicts $$ 27 ( 3^x - 1) = 25 ( 5^y - 1) $$ with $x,y \geq 1.$

Solution 4:

Wednesday morning B, 28 Sept. 2016

$$ 3^s = 5^t + 2, $$ two primes $19, 1621$

=================================

3^s  = 5^t + 2   

27 * ( 3^x - 1 ) = 25 * ( 5^y - 1)

jagy@phobeusjunior:~$ ./order 3 25
25    20 = 2^2 * 5
jagy@phobeusjunior:~$ ./order 5 27
27    18 = 2 * 3^2
jagy@phobeusjunior:~$ ./order 3 125
125   100 = 2^2 * 5^2
jagy@phobeusjunior:~$ ./order 5 81
81    54 = 2 * 3^3


========================================================
Given: 20 | x ,      18 | y
WANT    100 | x     OR   54 | y
========================================================

jagy@phobeusjunior:~$ ./prime_power_minus_one 3 20

    3^20 - 1    = 2^4 5^2 11^2 61  1181
jagy@phobeusjunior:~$ ./prime_power_minus_one 5 18

    5^18 - 1    = 2^3 3^3 7 19 31 829  5167
jagy@phobeusjunior:~$ ./order 3 19
19    18 = 2 * 3^2
jagy@phobeusjunior:~$ ./order 3 829
829   207 = 3^2 * 23
jagy@phobeusjunior:~$ ./order 3 5167
5167   738 = 2 * 3^2 * 41


use 19:   18 | x ==>  180 | x

jagy@phobeusjunior:~$ ./prime_power_minus_one 3 180

    3^180 - 1    = 2^4 5^2 7 11^2 13 19 31 37 61 73 181 271 757 1181 1621 4561 176401 387631 530713 755551 927001  cdot mbox{BIG} 

jagy@phobeusjunior:~$  ./order_mult 5 81 | head -20
811   405 = 3^4 * 5
1459   243 = 3^5
1621   405 = 3^4 * 5  ******************
1783   162 = 2 * 3^4
2269   567 = 3^4 * 7
2917  2916 = 2^2 * 3^6
3889   972 = 2^2 * 3^5
4051  2025 = 3^4 * 5^2
4861    81 = 3^4
5023   162 = 2 * 3^4
5347  5346 = 2 * 3^5 * 11
6481   405 = 3^4 * 5
6967  6966 = 2 * 3^4 * 43
7129   891 = 3^4 * 11

USE 1621:

jagy@phobeusjunior:~$  ./order 5 1621
1621   405 = 3^4 * 5

   405 | y AND 18 | y ==>  54 | y
jagy@phobeusjunior:~$ ./prime_power_minus_one 5 54

    5^54 - 1    = 2^3 3^4 7 19 31 109 163 271 487 829 4159 5167 31051  16018507

so 81 | 27 * ( 3^x - 1 ), contradicts x >= 1.

==================================