3. On the table, there are 160 different cards with numbers $5, 10, 15, \ldots, 795, 800$ (each card has exactly one number, and each number appears exactly once). In how many ways can 3 cards be chosen so that the sum of the numbers on the selected cards is divisible by 3?
Answer: 223342.

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

Among the given numbers, there are 53 numbers that give a remainder of 1 when divided by 3 (they form the set $A=\{10 ; 25 ; 40 ; \ldots ; 790\}$), 53 numbers that are divisible by 3 ($B=\{15 ; 30 ; 45 ; \ldots ; 795\}$), and 54 numbers that give a remainder of 2 when divided by 3 ($C=\{5 ; 20 ; 35 ; \ldots ; 800\}$).

The sum of three numbers can be divisible by 3 in the following cases.

1) All three numbers give the same remainder when divided by 3. There are $C_{54}^{3}$ ways to choose 3 numbers from set $C$ and $C_{53}^{3}$ ways to choose 3 numbers from sets $A$ and $B$. In total, we get $\frac{54 \cdot 53 \cdot 52}{6}+2 \cdot \frac{53 \cdot 52 \cdot 51}{6}=24804+2 \cdot 23426=71656$ ways.
2) If not all remainders are the same, the only suitable case is when all three remainders are different, i.e., we must choose one number from each of the sets $A, B, C$. We get $53 \cdot 54 \cdot 54=$ 151686 ways.

In total, we get 223342 ways.