[Math] How many of these numbers are divisible by 4

elementary-number-theorypermutations

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!

Best Answer

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$