5. The numbers from 100 to 999 are written without spaces. What is the remainder when the resulting 2700-digit number is divided by 7?
Solution.

Since 1001 is divisible by 7, we get $1000 \equiv-1(\bmod 7) \Longrightarrow 1000^{n} \equiv(-1)^{n}(\bmod 7)$. Therefore, the given number is congruent modulo 7 to the number

$$
999-998+997-996+\ldots+101-100=450 \equiv 2(\bmod 7)
$$

Answer: 2