How many numbers of 6 digits, that can be formed with digits 2,3,9. And also divided by 6? How many numbers of 6 digits, that can be formed with digits 2,3,9. And also divided by 6?
I was trying first when all are 9 but it have to have more restrictions what are they? 
 A: Since it is devieded by 6 it must be of the form XXXXX2 and also either (a) all of X's are 2 or (b) two of them must be 2 and the others can be 3 or 9.
For case (b) we have
$$C(5,2)=\frac{5!}{2!3!}=10$$
And for all cases of 3 and 9 we have: 2*2*2=8
Thus for both cases (a) and (b)  $$1+10\cdot8=81$$
A: HINT: Let $S(n)$ be the digit sum of $n$ in the decimal system.
$n$ is a multiple of $6$ $\iff$ "the rightmost digit is even" and "$S(n)$ is a multiple of $3$."
A: Hints:


*

*A number is divisible by $6$ if and only if it is divisible by both $2$ and $3$

*A number is divisible by $2$ if and only if it's last digit is even.

*A number is divisible by $3$ if and on if the sum of its digits is divisible by $3$.


2+3 imply put strong restrictions on the number of $2$'s in the numbers you are looking at.
A: Hint. Apparently all these numbers are even, and hence they are of the form:
$xxxxx2$. Also the sum of the digits should be divisible by $3$, and as $3$ and $9$ are divisible by $3$, while $2$ is not, then there should another two or another five incidents of two.
