[Math] Number of six digit numbers which are divisible by $6$

algebra-precalculus

The question is to find out the number of six digit numbers that can be formed using only the digits $2,3,9$ which are divisible by $6$


For a number to be divisible by $6$ it must be divisible by both $2$ and $3$ .For being divisible by $2$ last digit of the number should be $2$.Hence the question is all about finding out the number of non negative integral solution of equation $$3a+2b+9c=3k-2$$ for some positive $k$ under the constraint $a+b+c=5$.I couldn't proceed after this since it becomes difficult to deal with $k$.Any ideas?Thanks.

Best Answer

The number is divisible by $3$ if and only if the sum of its digits is divisible by $3$. So if you have a $2$, you must have three $2$'s. If you have four $2$'s then you must have six. So one number is $222,222$. All others must have three digits of $3$ or $9$ and then three $2$'s and end with $2$.

So first there are $\binom{5}{3} = 10$ ways to choose the non-$2$ digits. Each of those is either $3$ or $9$, so there are $8$ ways to fill in the non-$2$ digits for each of the $10$ patterns. So that's $80$. Add the $222,222$ case and the answer is $81$.

Related Question