## Task A-3.5.

Determine all pairs $(n, k)$ of natural numbers for which

$$
3^{n}=5 k^{2}+1
$$
## Solution.

Let's consider the remainders that the expressions from the given equation can give when divided by 5. We see that the right side gives a remainder of 1 when divided by 5. On the other hand, for all non-negative integers $l$, we have:

$$
3^{4 l+1} \equiv 3 \quad(\bmod 5), \quad 3^{4 l+2} \equiv 4 \quad(\bmod 5), \quad 3^{4 l+3} \equiv 2 \quad(\bmod 5), \quad 3^{4 l} \equiv 1 \quad(\bmod 5)
$$

Therefore, we conclude that 4 divides $n$. Let $n=4a$. From the initial equation, we now have

$$
5 k^{2}=3^{n}-1=3^{4a}-1=\left(3^{a}-1\right)\left(3^{a}+1\right)\left(3^{2a}+1\right)
$$

All three factors on the right side are even numbers, and the first two factors are two consecutive even numbers, so one of them is divisible by 4. Therefore, the entire product is divisible by 16. By setting $k=4b$, we get

$$
80 b^{2}=3^{4a}-1=\left(3^{a}-1\right)\left(3^{a}+1\right)\left(3^{2a}+1\right)
$$

Furthermore, since the first two factors on the right side differ by 2, and since

$$
\left(3^{2a}+1\right)=\left(3^{a}-1\right)\left(3^{a}+1\right)+2
$$

we conclude that the greatest common divisor of each pair of factors on the right side is 2, or in the expression

$$
10 b^{2}=\frac{3^{a}-1}{2} \cdot \frac{3^{a}+1}{2} \cdot \frac{3^{2a}+1}{2}
$$

all three factors on the right side of the equation are pairwise coprime. Therefore, each of these factors is equal to a square of a natural number multiplied by 1, 2, 5, or 10. The additional factors depend on the parity of $a$.

If $a$ is an even number, from the cases for the remainders of $3^{n}$ when divided by 5, we conclude that $3^{2a}+1$ is not divisible by 5. Also, it is not divisible by 4, so it must be $3^{2a}+1=2x^{2}$, for some natural number $x$. However, in this case, there is no solution, since the left side gives a remainder of 1 when divided by 3, while the right side gives 0 or 2.

If $a$ is an odd number, then $2a$ is of the form $4l+2$, so we conclude that $3^{2a}+1$ is divisible by 5. Furthermore, $3^{a}$ for odd $a$ gives a remainder of 3 when divided by 4, so we conclude that it must be

$$
\frac{3^{a}-1}{2}=x^{2}, \quad \frac{3^{a}+1}{2}=2y^{2}, \quad \frac{3^{2a}+1}{2}=5z^{2}
$$

for some natural numbers $x, y$, and $z$.

From the second equality, we get $3^{a}=(2y-1)(2y+1)$. On the right side, we have the product of two consecutive odd numbers, so they are coprime. Since their product is a power of 3, we conclude that this is possible only if the smaller of them is equal to 1, i.e., $y=1$, so $a=1$. In this case, we get $n=4$ and $k=4$, or we get the only solution to the equation.

Thus, the only solution is $(n, k)=(4,4)$.

## NATIONAL MATHEMATICS COMPETITION

## 4th grade - high school - A variant

## October 26, 2020.