## Task A-4.4.

Find all triples of natural numbers $(m, n, k)$ such that $3^{m}+7^{n}=k^{2}$.
## Solution.

Let $m, n$ and $k$ be natural numbers that satisfy the given equation.

Since $7^{n}=k^{2}-3^{m}$ is divisible by 7, it follows that $k^{2}$ and $3^{m}$ must give the same remainder when divided by 7, which is only possible if $m$ is an even number.

Thus, $m=2 l$ for some natural number $l$, and we can write

$$
7^{n}=\left(k-3^{l}\right)\left(k+3^{l}\right)
$$

From the above equation, it follows that both factors are powers of $7$, i.e.,

$$
\begin{aligned}
& k-3^{l}=7^{a} \\
& k+3^{l}=7^{b}
\end{aligned}
$$

where $a$ and $b$ are some non-negative integers.

Subtracting the first equation from the second, we get

$$
2 \cdot 3^{l}=7^{a}\left(7^{b-a}-1\right)
$$

Since $2 \cdot 3^{l}$ is not divisible by 7, it follows that $a=0$ and

$$
1+2 \cdot 3^{l}=7^{b}
$$

For $l=1$, we get $m=2$ and $n=1$, so $k=4$.

If $l \geqslant 2$, then $7^{b}=1+2 \cdot 3^{l}$ gives a remainder of 1 when divided by 9.

Considering the remainders of the powers of 7 when divided by 9, we conclude that $b$ must be divisible by $3$, i.e., $b=3 s$ for some natural number $s$.

Due to the formula for the difference of powers, $7^{b}-1$ is divisible by $7^{3}-1=342=2 \cdot 3^{2} \cdot 19$.

Thus, 19 divides $7^{b}-1$. However, on the other hand, it is impossible for $2 \cdot 3^{l}=7^{b}-1$ to be divisible by 19.

The only solution is $(2,1,4)$.