## Task 2 - 130932

Determine all natural numbers $n$ for which $(n-1)^{3}+n^{3}+(n+1)^{3}$ is divisible by 10!
It is $(n-1)^{3}+n^{3}+(n+1)^{3}=3 n^{3}+6 n=3 n\left(n^{2}+2\right)$. Furthermore, $n^{2}+2$ is even if and only if $n$ is also even. Because $(5 k \pm 1)^{2}+2=25 k^{2} \pm 10 k+1+2=5 \cdot\left(5 k^{2} \pm 2 k\right)+3$ and $(5 k \pm 2)^{2}+1=$ $25 k^{2} \pm 20 k+4+1=5 \cdot\left(5 k^{2} \pm 4 k+1\right)$, $n^{2}+2$ is divisible by 5 if and only if $n$ leaves a remainder of 2 or 3 when divided by 5.

Thus, $3 n\left(n^{2}+2\right)$ is divisible by 5 if and only if $n$ leaves a remainder of 0 (then $n$ is divisible by 5), 2, or 3 (then $n^{2}+2$ is divisible by 5) when divided by 5.

Moreover, $3 n\left(n^{2}+2\right)$ is divisible by 2 if and only if $n$ is also divisible by 2.

Together it follows (because $\operatorname{ggT}(2,5)=1$), that $(n-1)^{3}+n^{3}+(n+1)^{3}=3 n\left(n^{2}+2\right)$ is divisible by 10 if and only if it is divisible by 2 and 5, which means $n$ has the last digit 0, 2, or 8.

## Solution by cyrix

Second solution:

Exactly then is

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

divisible by 10 if one of the following conditions is met:

$10 \mid n$

$10 \mid\left(n^{2}+2\right)$

$5 \mid n$ and $2 \mid\left(n^{2}+2\right)$

$2 \mid n$ and $5 \mid\left(n^{2}+2\right)$

Condition (1) is met by all natural numbers $n$ that are divisible by 10. Condition (2) could only be met by natural numbers $n$ whose square ends in 8. Such numbers do not exist, as for a number $10 k+r$ with $0 \leq r<10$ the square $(10 k+r)^{2}$ is equal to $10 l^{\prime}+r^{\prime}$ with $r^{\prime} \in\{0,1,4,5,6,9\}$.

Assume there are natural numbers $n$ that satisfy (3) or (4), but not (1). Such a number would have to end in 5 due to (3) or its square would have to end in 3 or 8 due to (4). There are no natural numbers whose square ends in 3 or 8.

If $n$ ends in 5, then $n^{2}$ and thus also $n^{2}+2$ is odd, and therefore not divisible by 2. Consequently, exactly all natural numbers that are divisible by 10 satisfy the conditions of the problem.

## Taken from $[2]$