# Permutation and Combination with divisibility?

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

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

-

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.

-

You haven’t taken into account the requirement that the numbers be divisible by $3$.

Since you’re allowed to use only the six digits $0,1,2,3,4$, and $5$ and are not allowed to repeat any digit, there are just $6$ possible sets of digits that you can use, $\{0,1,2,3,4\}$, $\{0,1,2,3,5\}$, $\{0,1,2,4,5\}$, $\{0,1,3,4,5\}$, $\{0,2,3,4,5\}$, and $\{1,2,3,4,5\}$. An integer is divisible by $3$ if and only if the sum of its digits is divisible by $3$, so only the sets $\{0,1,2,4,5\}$ and $\{1,2,3,4,5\}$ will actually give you multiples of $3$. Every permutation of each of these sets gives you a multiple of $3$.

• How many permutations of the digits $1,2,3,4$, and $5$ are there?
• How many permutations of the digits $0,1,2,4$, and $5$ are there that do not start with $0$?

Thus sum of those two numbers is what you’re looking for.

-

You only substracted the numbers with 0 at the peginning however: the divisibilty rule for three says that for a number to be a multiple of 3 the sum of its digits needs to be a multiple of three. So really it does not matter what order you put the numbers in but the sum of the numbers themselves. There are in total 6 combinations of numbers you can pick. which are

$1+2+3+4+5 = 15$

$0+2+3+4+5 = 14$

$0+1+3+4+5 = 13$

$0+1+2+4+5 = 12$

$0+1+2+3+5 = 11$

$0+1+2+3+4 = 10$

Therefore only the combinations that use 1,2,3,4,5 or 0,1,2,3,4 are divisible by 3. There are 5! of the first one = 120. However we cant pick combinations which start with zero so there are 5!-4!of the second one= 96. Add them to get 216.

-