4. On the table, there are 100 different cards with numbers $3, 6, 9, \ldots 297, 300$ (each card has exactly one number, and each number appears exactly once). In how many ways can 2 cards be chosen so that the sum of the numbers on the selected cards is divisible by $5?$
Answer: 990.

Solution. The given numbers, arranged in ascending order, form an arithmetic progression with a common difference of 3. Therefore, the remainders of these numbers when divided by 5 alternate. Indeed, if one of these numbers is divisible by 5, i.e., has the form $5k$, where $k \in \mathbb{N}$, then the next number is $5k+3$ - and it gives a remainder of 3 when divided by 5; then $-5k+6=5(k+1)+1$, giving a remainder of 1 when divided by 5; then $-5k+9=5(k+1)+4$, giving a remainder of 4 when divided by 5; then $5k+12=5(k+2)+2$, giving a remainder of 2 when divided by 5; finally, the next one is $5k+15=5(k+3)$, which is again divisible by 5, after which the order of remainders repeats. Thus, the remainders of the given numbers when divided by 5 go in the order $\ldots 0 ; 3 ; 1 ; 4 ; 2 ; 0 \ldots$

Among the 100 given numbers, there are 20 numbers that give remainders of $0, 1, 2, 3, 4$ when divided by 5.

The sum of two numbers can be divisible by 5 in the following cases.

1) Both numbers are divisible by 5. There are 20 cards with such numbers, and we need to choose 2 of them - there are $C_{20}^{2}=$ $\frac{1}{2} \cdot 20 \cdot 19=190$ ways to do this.
2) One of the numbers gives a remainder of 1 when divided by 5 - then the other must give a remainder of 4 when divided by 5. This pair of numbers can be chosen in $20 \cdot 20=400$ ways.
3) One of the numbers gives a remainder of 2 when divided by 5 - then the other gives a remainder of 3, and, similarly to the second case, we get 400 ways to choose 2 numbers.

In total, there are 990 ways.