## Task 6B - 331246B

Determine all pairs $(m ; n)$ of non-negative integers $m, n$ for which $2^{m}-5^{n}=7$ holds.
For a fixed value of $n \in \mathbb{N}$, the equation $2^{m}-5^{n}=7$ has exactly one real solution $m \in \mathbb{R}$, namely

$$
m=\log _{2}\left(5^{n}+7\right)
$$

and only when this value of $m$ is an integer, is $(m, n)$ also a solution to our problem. In this way, for the values $n=0,1,2$, the solutions, if they exist, can be easily determined, yielding the two solutions

$$
(m, n) \in\{(3,0),(5,2)\}
$$

Our goal is to show that these are the only solutions, i.e., that assuming $n>2$ (and thus also $m>5$), which we will assume from now on, leads to a contradiction to the solvability of the equation.

To do this, we first rewrite the original equation as

$$
2^{5}\left(2^{m-5}-1\right)=5^{2}\left(5^{n-2}-1\right)
$$

From this representation, it is immediately clear that

$$
25 \mid 2^{m-5}-1 \quad \text { or } \quad 2^{m-5} \equiv 1 \quad \bmod 25
$$

holds. Since, as one can easily verify, the sequence of powers of 2 modulo 25 has a period of 20, it must already be the case that

$$
m \equiv 5 \quad \bmod 20
$$

Moreover, it must also be the case that

$$
m \not \equiv 5 \quad \bmod 100 \quad(* *)
$$

because otherwise the left side of (*) would be divisible by 125, but the right side would not. With a similar reasoning, we see that from

$$
32 \mid 5^{n-2}-1 \quad \text { or } \quad 5^{n-2} \equiv 1 \quad \bmod 32
$$

and the fact that the sequence of powers $5^{k} \bmod 32, k=0,1,2, \ldots$ has a period of 8, it follows that

$$
n \equiv 2 \quad \bmod 8
$$

must hold. Because

$$
2^{20}-1 \mid 2^{m-5}-1 \quad \text { and } \quad 2^{20} \equiv 1 \quad \bmod 31
$$

the expression $5^{n-2}-1$ on the right side of $\left(^{*}\right)$ must also have the prime factor 31. By considering the sequence $5^{k} \bmod 31, \quad k=0,1,2, \ldots$, which has a period of 3, we can conclude that $n-2$ must be divisible by $24(=3 \cdot 8)$. However,

$$
5^{24} \equiv 1 \quad \bmod 601
$$

for the prime number 601, so the factor $5^{n-2}-1$ on the right side of $(*)$ and thus also the factor $2^{m-5}-1$ on its left side must have this prime factor. The sequence $2^{k} \bmod 601, k=$ $0,1,2, \ldots$ has a period of 25, meaning it must be the case that

$$
m \equiv 5 \quad \bmod 25
$$

In connection with the already proven relationship $m \equiv 5 \bmod 20$, it ultimately follows that

$$
m \equiv 5 \quad \bmod 100
$$

which is in clear contradiction to $\left({ }^{* *}\right)$, q.e.d.