4. On the table, there are 150 different cards with numbers $2, 4, 6, \ldots 298, 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: 2235.

Solution. The given numbers, arranged in ascending order, form an arithmetic progression with a difference of 2. 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+2$ - and it gives a remainder of 2 when divided by 5, then $-5k+4$, giving a remainder of 4 when divided by 5, then $5k+6=5(k+1)+1$, giving a remainder of 1 when divided by 5, then $5k+8=5(k+1)+3$, giving a remainder of 3 when divided by 5; finally, the next one is $5k+10=5(k+2)$, 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 ; 2 ; 4 ; 1 ; 3 ; 0 \ldots$

Among the 150 given numbers, there are 30 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 30 cards with such numbers, and we need to choose 2 of them - there are $C_{30}^{2}=$ $\frac{1}{2} \cdot 30 \cdot 29=435$ ways to do this.
2) One of the numbers gives a remainder of 1 when divided by 5 - then the second number must give a remainder of 4 when divided by 5. This pair of numbers can be chosen in $30 \cdot 30=900$ ways.
3) One of the numbers gives a remainder of 2 when divided by 5 - then the second number gives a remainder of 3, and, similarly to the second case, we get 900 ways to choose 2 numbers.

In total, there are 2235 ways.