5. Find the number of pairs of natural numbers $(x, y), 1 \leqslant x, y \leqslant 1000$, such that $x^{2}+y^{2}$ is divisible by 5.
Answer: 360000.

Solution: We have 200 numbers for each of the remainders $0,1,2,3,5$ when divided by 5. There are two cases: a) the numbers $x, y$ are both divisible by 5; b) or one number gives a remainder of 1 or 4, and the other gives a remainder of 2 or 3 when divided by 5. In the first case, we get $200 \times 200=40000$ options, in the second case $2 \times 400 \times 400=320000$, in total $40000+320000=$ 360000.