$5^m = 2 + 3^n$ help what to do

I like to reformulate the problem a bit to adapt it to my usances. $$5^m = 2+3^n \\5^m = 5-3+3^n \\ 5(5^{m-1}-1) = 3(3^{n-1}-1) $$ $$ \tag 1 {5^a-1 \over 3} = {3^b-1 \over 5} \\ \small \text{ we let a=m-1 and b=n-1 for shortness}$$

Now we get concurring conditions when looking at powers of the primefactor decomposition of the lhs and the rhs.


I must introduce two shorthand-notations for the following. We write
$\qquad 1. \qquad [a:p] = 1 $ if p is a factor in a, and $ [a:p] = 0 $ if not (this is the "Iverson-bracket")

$\qquad 2. \qquad \{a,p\} = m $ meaning, that m is the exponent, to which p is a primefactor in a .


We begin to look at p=3 in the lhs and q=5 in the rhs in(1) (both can occur only once in the numerators) and then at powers of the primefactor p=2 , p=7 and p=13 which must be equal on both sides. It shows a systematic approach, which can also be taken for similar problems.


The primefactors, which must occur differently:

The occurence of the primefactor 3 in the lhs is determined by the formula $$ \{5^a-1,3\} = [a:2](1 + \{a,3\}) $$ and because it is allowed to occur exactly once, a must be even and not divisible by 3 so $$a = \pm 2 \pmod 6) \tag 2$$ The occurence of the primefactor 5 in the rhs is determined by the formula $$ \{3^b-1,5\} = [b:4](1 + \{b,5\}) $$ and because it is allowed to occur exactly once, b must be divisible by 4 and not divisible by 5 so $$b = (4,8,12,16) \pmod {20} \tag 3$$


The primefactors, which must occur equally:

Looking at the primefactor 2 we have for the lhs: $$ \{5^a-1,2\} = 2 + \{a,2\} \tag {3.1} $$ and for the rhs $$ \{3^b-1,2\} = 1 + [b:2]+ \{b,2\}) \tag {3.2} $$

We have from the previous that b must be divisible by 4 so the exponent of primefactor 2 must be at least 4 by (3.2) and thus a must also be divisible by 4 (and must in fact have the same number of primefactors 2 as b).

Looking at the primefactor 7 we have for the lhs: $$ \{5^a-1,7\} = [a:6] (1 + \{a,7\}) \tag {4.1}$$ and for the rhs $$ \{3^b-1,7\} = [b:6](1 + \{b,7\}) \tag {4.2} $$ From this because a cannot be divisible by 6 by the needed equality of powers of primefactor 7 also b cannot be divisible by 6.

Looking at the primefactor 13 we have for the lhs: $$ \{5^a-1,13\} = [a:4] (1 + \{a,13\}) \tag {5.1} $$ and for the rhs $$ \{3^b-1,13\} = [b:3](1 + \{b,13\}) \tag {5.2}$$
Now we get contradictory conditions: We know already that a must be divisible by 4 thus the primefactor p=13 shall occur in the lhs of (1) by (5.1). But because b is even but never divisible by 6, it is also never divisible by 3 and thus the primefactor 13 does not occur in the rhs of (1) by (5.2).

Conclusion: no further solution after the "trivial" one for n=m=1


Assume there is a solution with $n>1$. Then $ 5^m \equiv 2 \pmod 9 \Rightarrow m \equiv 5 \pmod 6$.

Then $ 5^m \equiv 3 \pmod 7 \Rightarrow 3^n \equiv 1 \pmod 7 \Rightarrow n \equiv 0 \pmod 3.$

Also, $ 5^m \equiv 5 \text { or } 8 \pmod {13} \Rightarrow 3^n \equiv 3\text { or } 6 \pmod {13} \Rightarrow n \equiv 1 \pmod 3.$

This contradiction means that $n$ cannot be greater than $1$ and so $m=n=1$.