[Math] Permutation and Combination with divisibility

permutations

How many five digit positive integers that are divisible by 3 can be formed using the digits 0, 1, 2, 3, 4 and 5, without any of the digits getting repeating?

my explanation:
total number of permutations with 0, 1, 2, 3, 4 and 5
to have 5 digits = 6.5.4.3.2=720 (includes numbers with 0 at the beginning)

now let us find the numbers with zero at the beginning = 5.4.3.2=120

so total no of digits = 720 – 120 = 600

but this is not the answer? the correct answer is 216.

can somebody correct me whats wrong with my approach and suggest a better solution.

Best Answer

You should note that not every five-digit number made of 0,1,2,3,4,5 is divisible by 3.

A number is divisible by 3 if the sum of its digits is. Since $0+1+2+3+4+5 = 15$, which is divisible by $3$, and you need only 5 digits, you must leave our a number that's divisible by 3, namely $0$ or $3$.

If you leave out $0$, you end up with five numbers, which can be ordered in $5! = 120$ ways.

If you leave out $3$, you end up with $120$ numbers again, but $\frac{1}{5}$ of them would begin with $0$ so they actually have $4$ digits. This means you have to rule out $\frac{120}{5} = 24$ numbers.

To sum up, you have $120 + 120 - 24 = 216$ as you mentioned.