## Task 4 - 271214

Determine the remainder when the sum $s=1^{5}+2^{5}+3^{5}+\ldots+1987^{5}$ is divided by 25!
For every natural number $a$, there exist natural numbers $m$ and $r$ with $0 \leq r \leq 4$ such that $n=5 m+r$. It holds that:

$$
(5 m+r)^{5}=5^{5} \cdot m^{5}+5 \cdot 5^{4} \cdot m^{4} \cdot r+10 \cdot 5^{3} \cdot m^{3} \cdot r^{2}+10 \cdot 5^{2} \cdot m^{3} \cdot r^{3}+5 \cdot 5 \cdot m \cdot r^{4}+r^{5}
$$

Consequently, $(5 m+r)^{5}$ leaves the same remainder as $r^{5}$ when divided by $25\left(=5^{2}\right)$.

Case distinction:

If $r$ is equal to then $r^{5}$ is equal to and the remainder of $r^{5}$ when divided by 25 is $0,1,2,3,4$

$0,1,32,243,1024$

$0,1,7,18,24$

Among the numbers $1^{5}, 2^{5}, \ldots, 1987^{5}$ (since $1987=5 \cdot 397+2$), there are exactly 397 numbers of the form $(5 k)^{5}$, $(5 k+3)^{5}$, and $(5 k+4)^{5}$, and exactly 398 numbers of the form $(5 k+1)^{5}$ and $(5 k+2)^{5}$. This means there are 397 numbers that leave a remainder of 0, 18, or 24 when divided by 25, and 398 numbers that leave a remainder of 1 or 7 when divided by 25.

The sum of the remainders when $1^{5}, 2^{5}, \ldots, 1987^{5}$ are divided by 25 is thus

$$
397 \cdot 18 + 397 \cdot 24 + 398 \cdot 1 + 398 \cdot 7 = 397 \cdot (18 + 7) + 7 + 397 \cdot (24 + 1) + 1 = 397 \cdot 25 + 397 \cdot 25 + 8
$$

Therefore, $s=1^{5}+2^{5}+3^{5}+\ldots+1987^{5}$ leaves a remainder of 8 when divided by 25.

Taken from $[5]$

### 9.29.2 Second Round 1987, Class 12