Exercise 8. Determine all pairs \((m, n)\) of strictly positive integers such that:

$$
125 \times 2^{n} - 3^{m} = 271
$$
## Solution to Exercise 8

Since 125 is a cube, it would be good to prove that $n$ and $m$ are multiples of 3 to be able to factor the left side of the equation. For this purpose, we look at the equation modulo a prime number congruent to 1 modulo 3.

For example, let's look modulo 7. The powers of 3 modulo 7 are $1, 3, 2, 6, 4, 5, 1$ and those of 2 are $1, 2, 4, 1$. Since $271 \equiv 5 \pmod{7}$ and $125 \equiv -1$, the only possibilities are to have the power of 2 equal to 1 and the power of 3 equal to 1, or the power of 2 equal to 4 and the power of 3 equal to 5. Thus, we have $n \equiv 0 \pmod{3}$ and $m \equiv 0 \pmod{6}$ or $n \equiv 2 \pmod{3}$ and $m \equiv 5 \pmod{6}$. If we can exclude the second possibility, then $m$ and $n$ are divisible by 3. Note that we must have $n \geq 2$ because $250 < 271$. Looking modulo 4, we have $3^m \equiv 1$, so $m$ is even, and we cannot have $m \equiv 5 \pmod{6}$. The second possibility is therefore excluded, and the integers $m$ and $n$ are divisible by 3.

We set $m = 3k$ and $n = 3\ell$. The equation becomes

$$
271 = \left(5 \times 2^k\right)^3 - \left(3^\ell\right)^3 = \left(5 \times 2^k - 3^\ell\right)\left(25 \times 2^{2k} + 5 \times 2^{k+1} \times 3^\ell + 3^{2\ell}\right)
$$

Since 271 is prime and $\left(25 \times 2^{2k} + 5 \times 2^{k+1} \times 3^\ell + 3^{2\ell}\right)$ is positive and strictly greater than $\left(5 \times 2^k - 3^\ell\right)$, we have $5 \times 2^k - 3^\ell = 1$. If $k \geq 3$, then $3^\ell \equiv -1 \pmod{8}$, which is not possible because $3^\ell$ is 1 or 3 modulo 8. Therefore, we have $k = 0, 1, 2$. For $k = 0$, we get $3^\ell = 4$, which is impossible. For $k = 2$, we get $3^\ell = 19$, which is also impossible. For $k = 1$, we get $3^\ell = 9$, so $\ell = 2$, and thus $(n, m) = (3, 6)$.

Conversely, $125 \times 2^3 - 3^6 = 1000 - 729 = 271$, so $(3, 6)$ is indeed a solution.

The only solution to the equation is therefore the pair $(3, 6)$.

## Alternative Solution 1

By looking at the equation modulo 5, we find that $-3^m \equiv 1 \pmod{5}$, so $3^m \equiv -1 \pmod{5}$. The order of 3 modulo 5 is 4, and the powers alternate between $1, 3, -1, -2$. We deduce that $m \equiv 2 \pmod{4}$.

Suppose that $n \geq 4$. Then, looking at the equation modulo 16, we have $-3^m \equiv 271 \equiv -1 \pmod{16}$, so $3^m \equiv 1 \pmod{16}$. The order of 3 modulo 16 is 4, since $3^0 \equiv 1$, $3^1 \equiv 3$, $3^2 \equiv 9$, $3^3 \equiv 11$, and $3^4 \equiv 1 \pmod{16}$. Therefore, we must have $m \equiv 0 \pmod{4}$, which contradicts the previous assumption.

Thus, we have $n < 4$.

- If $n = 3$, the equation is equivalent to $729 = 3^m$. Since $729 = 3^6$, the equation gives $m = 6$. We find that the pair $(6, 3)$ is a solution.
- If $n = 2$, we get $3^m = 229$, which is not divisible by 3, a contradiction.
- If $n = 1$, $3^m = 250 - 271 < 0$, which is impossible.

Thus, the unique solution is $(m, n) = (6, 3)$.

Comment from the graders: The exercise was not widely attempted, but the submitted solutions were mostly excellent. However, be careful to be rigorous in your justifications. Some students obtain that the product of two factors is 271, which is prime, and directly deduce that the first factor is 271 and the second factor is 1: to obtain this, it is necessary to justify that both terms are positive and that the first is greater than the second.