In how many ways can three different integers be selected Question:
In how many ways can three different integers be selected from the numbers $1$ to $12$,so that their sum can be exactly divided by $3$?
Solution:
if order is not important (as i am not sure about this) total ways=  $4\cdot3\cdot2  + (4\cdot4\cdot4)\cdot 3!= 24 + 192 = 216$
if order is important, total ways = $\binom{4}{3} + \binom{4}{1}\cdot\binom{4}{1}\cdot\binom{4}{1} = 4 + 64 = 68$
Is my solution correct?
 A: Note that in order that the sum of $3$ number will be divided by $3$, you have that their sum modulo $3$ will be $0$, therefore you could have the next possibilities:


*

*$3$ numbers that are $0$ modulo $3$

*$3$ numbers that are $1$ modulo $3$

*$3$ numbers that are $2$ modulo $3$

*$3$ numbers such that one is $0$ modulo $3$, one is $1$ modulo $3$ and one is $2$ modulo $3$


it's not hard to calculate each one of those cases, and since they are disjoint the sum of them to get the wanted result.
A: In the range $[1,12]$ we have:


*

*Exactly $4$ values of $n$ such that $n\equiv0\pmod3$

*Exactly $4$ values of $n$ such that $n\equiv1\pmod3$

*Exactly $4$ values of $n$ such that $n\equiv2\pmod3$


Therefore we can split it into the following disjoint cases:


*

*$a,b,c\equiv0,0,0\pmod3\implies\binom43=4$ combinations

*$a,b,c\equiv1,1,1\pmod3\implies\binom43=4$ combinations

*$a,b,c\equiv2,2,2\pmod3\implies\binom43=4$ combinations

*$a,b,c\equiv0,1,2\pmod3\implies4^3=64$ combinations


Therefore we have $4+4+4+64=76$ combinations altogether.
