# How many of these numbers are divisible by 4?

There is this question that I have no idea where did I make the mistake.

Each of the digits 1,1,2,3,3,4,6 is written on a separate card. The seven cards are then laid out in a row to form a 7-digit number. How many of these 7-digit numbers are divisible by 4?

My working: In order for a number to be divisible by 4, first they must be even. So the last digit can be 2 or 4 or 6. Then we check for the second last number:
if the last is 2, then the second last can only be 1 or 3,
if the last is 4, then the second last can only be 2 or 6,
if the last is 6, then the second last can only be 1 or 3.
Then, for the remaining 5 numbers we have 5! ways, but there are 2 1's and 2 3's. So in total we have $\frac{5!\times 6}{2!2!}=180$. But the solutions says 300.

Am I wrong? Where did I make the mistake?

I really appreciate any helps! Many many thanks!

• How do you form a $7$-digit number using only $6$ digits? – angryavian Feb 28 '14 at 2:16
• There are only 6 numbers. Is this with replacement? Want 6 instead? – bobbym Feb 28 '14 at 2:16
• Sorry, yes I have added one more 3. No, I think this is without replacement, since the cards are laid out in a row. – user71346 Feb 28 '14 at 2:18
• You might get some help from this math.stackexchange.com/questions/58349/… – bobbym Feb 28 '14 at 2:27
• @bobbym, thanks. I think I get the ideas correct. But the different with the question you shared is that my question has two 1's and two 3's. So I divide it by 2!*2!. – user71346 Feb 28 '14 at 2:31

Building off your work:

Last digit is 2: Second last can be 1 or 3. For either 1 or 3, one of the repeated numbers is already used and isn't counted as repeated, so there's $\frac{2 \times 5!}{2!} = 120$

Last digit is 4: What you had is correct. $\frac{2 \times 5!}{2!2!} = 60$

Last digit is 6: Same logic as last digit of 2. $120$

$120 + 120 + 60 = 300$

The number of distinct permutations of the remaining numbers will depend on the choice of the lowest two digits. For example, if the lowest two digits are $12$, there are $\frac{5!}{2!}$ permutations of the remaining digits, since one of the repeated $1$s is already used.

• Thanks augurar. Do you mean we have to divide into cases. I think I have done that, do you mind explaining in more details? Thanks. – user71346 Feb 28 '14 at 2:24

@user71346

I am getting these cases for the last 2.

(3,2),(1,2),(2,4),(6,4),(1,6),(3,6)

$\frac{5!}{2!}+\frac{5!}{2!}+\frac{5!}{2!\cdot 2!}+ \frac{5!}{2!\cdot 2!}+\frac{5!}{2!}+\frac{5!}{2!}=300$

Your mistake is that you may have used up one of the $1$'s or $3$'s in the last two digits. In that case, you should only divide by one $2!$. You get the same $60$ cases you found if the last is $4$, but twice as many if the last is $2$ or $6$. That gives $60+120+120=300$