How many positive integers less than $1000$ divisible by $3$ with sum of digits divisible by $7$? 
How many positive integers less than $1000$ are divisible by $3$ with their sum of digits being divisible by $7$?

Well, I got Answer: $28$.
$a+b+c = 7k$  and $a,b,c$ are multiples of 3 so $a+b+c$ is a multiple of both $7$ and $3$.
Therefore $a+b+c=21$.
$(9-a)+(9-b)+(9-c)=6$
Then $^8C_2$. Can anyone explain why there is $9-a+9-b+9-c$?
If you have any other alternative method please explain?

A number is divisible by $3$ iff the sum of its digits (in the decimal representation) is divisible by $3$. Since $3$ and $7$ are coprime, the problem boils down to finding the number of non-zero triples $(a,b,c)$ such that $a,b,c\in\{0,1,2,\ldots,9\}$ and $21\mid a+b+c$. $a+b+c$ is at most $27$, hence the problem is equivalent to finding the non-zero triples $(a,b,c)$ with $a,b,c\in\{0,1,2,\ldots,9\}$ and $a+b+c\color{blue}{=}21$. The answer is given by
$$ [x^{21}](1+x+x^2+\ldots+x^9)^3 = [x^{21}]\frac{(1-x^{10})^3}{(1-x)^3} $$
where $[x^k]\,f(x)$ stands for the coefficient of $x^k$ in the Taylor/Laurent series of $f(x)$ at the origin.
Since $\frac{1}{(1-x)^3}=\sum_{m\geq 0}\binom{m+2}{2}x^m$ and $(1-x^{10})^3 = 1-3x^{10}+3x^{20}-x^{30}$, the previous number equals
$$ \binom{21+2}{2}-3\binom{11+2}{2}+3\binom{1+2}{2}=28$$
so there are $\color{blue}{28}$ numbers in $\{1,2,\ldots,999\}$ whose digit sum is a multiple of both $3$ and $7$.
