# How many numbers of 6 digits, that can be formed with digits 2,3,9. And also divided by 3?

How many numbers of 6 digits, that can be formed with digits 2,3,9. And also divided by 3?  I was trying to to add 2^6 (when there is no 2)+ C(6,2)2^2 (when 2 can be in two places)+C(6,3)2^3 (when 2 can be in three places)...

• Closely related to this and this. – Lucian Dec 28 '13 at 17:45

For the first question, you have three choices for each of the six digits.

As a hint for the second question: a number is divisible by $3$ if and only if its digit sum is divisible by $3$. If your number is formed out of $2$'s, $3$'s and $9$'s, this imposes conditions on how many $2$'s can appear: In particular, $2$ must appear $0$, $3$ or $6$ times.

As a particular case, for when it appears $3$ times: There are $6 \choose 3$ options for where to place the twos, and each of the remaining three positions have two choices; this leads to

$$2^3 \cdot {6 \choose 3}$$

possibilities.

• Why 2 can't appear 2 times? – user7777777 Dec 28 '13 at 8:01
• @user7777777 Because then the digit sum isn't divisible by $3$. – user61527 Dec 28 '13 at 8:01
• Shouldn't it be 2^3 instead of 3^2? – sebii Dec 28 '13 at 8:06
• @sebii Yes, thanks. – user61527 Dec 28 '13 at 8:09
• instead of being divided by 3, now divided by 6? how can I solve this? – user7777777 Dec 28 '13 at 8:55

The number of twos have to be zero, three or six.