combinatorics problem - sum of integers

You're almost there.

The two ways, as you've stated, are adding two numbers that are $0 \mod 3$, or adding a number that's $1 \mod 3$ to one that's $2 \mod 3$.

Since you're drawing from the same pool of numbers in the first case, choose two of them since they have to be distinct: $_{20}C_2$.

In the second case, you know that the numbers are distinct (no number is both $1 \mod 3$ and $2 \mod 3$) so pick one from the first group, and one from the second: $20^2$.

So, $190 + 400 = 590$ pairs.


There are only 2 cases which satisfy your criterion - (0m3,0m3) and (1m3,2m3) . The numbers are $\binom{20}{2}+ 20^2=590$.


The problem with your solution is that your cases (1m3,1m3), (2m3,2m3), (0m3,1m3), and (0m3,2m3) don't work. The counterexamples to each cases are actually all numbers that fit the criteria, but here are some specifics so you can see for yourself: (4,4), (5,5), (3,4), and (3,5).

Now the remaining cases that work are (0m3, 0m3) and (1m3, 2m3). The first case has $\binom{20}{2}$ that work. The second case has $20^2$ cases that work.