# Six digit numbers that are divisible by 3

A question I encountered recently :

A six digit number divisible by $3$ is to be formed using the digits $0,1,2,3,4$ and $5$ without repetition. How many number of ways can this be done ?

If it asked for numbers divisible by $2$, I know how to proceed -- the last digit could be $0, 2$ or $4$. But I have no idea how to do this problem.

Hint: A number is divisible by $3$ if the sum of the digits is divisible by $3$.

• So, I've to choose the numbers only ? – H G Sur Nov 26 '15 at 11:50
• yep! All the permutation of the 6 digits give you a number divisible by $6$. But remember $0$ cannot be the first digit. – Jack Frost Nov 26 '15 at 11:51
• Thank you! Now I've got it :) – H G Sur Nov 26 '15 at 11:54

Is it $6! -5! = 600$?
$1+2+3+4+5+0 = 15$ (Divisibility rule of 3)
There are $6!$ permutations for the $6$ digit places given that no repetitions are allowed. And then since $0$ could not be on the hundred thousands place, you must exclude it from the rest.
The permutations to be excluded can be determined by dividing $6!$ by $6$ or simply $5!$.