3. On the table, there are 140 different cards with numbers $4, 8, 12, \ldots, 556, 560$ (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: 149224.

Solution. The given numbers, arranged in ascending order, form an arithmetic progression with a difference of 4. Therefore, the remainders of these numbers when 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+4=3(k+1)+1$ - and it gives a remainder of 1 when divided by 3, followed by $3k+8=3(k+2)+2$, which gives a remainder of 2 when divided by 3, and then $-3k+12$, which is again divisible by 3. Thus, the remainders of the given numbers when divided by 3 go in the order $\ldots 0 ; 1 ; 2 ; 0 ; 1 ; 2 ; 0 \ldots$

Among the given numbers, there are 47 that give a remainder of 1 when divided by 3 (they form the set $A=\{4 ; 16 ; 28 ; \ldots ; 556\}$), 46 numbers that are divisible by 3 ($B=\{12 ; 24 ; 36 ; \ldots ; 552\}$), and 47 numbers that give a remainder of 2 when divided by 3 ($C=\{8 ; 20 ; 32 ; \ldots ; 560\}$).

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_{46}^{3}$ ways to choose 3 numbers from set $B$ and $C_{47}^{3}$ ways to choose 3 numbers from sets $A$ and $C$. In total, we get $\frac{46 \cdot 45 \cdot 44}{6}+2 \cdot \frac{47 \cdot 46 \cdot 45}{6}=15180+2 \cdot 16215=47610$ ways.
2) If not all remainders are the same, then only the case where all three remainders are different fits, i.e., we must choose one number from each of the sets $A, B, C$. We get $47 \cdot 47 \cdot 46=$ 101614 ways.

In total, we get 149224 ways.