Six digit permutations of 1 to 6 - divisible by 8

375 Views Asked by At

I am working on a problem in A Concise Introduction to Pure Mathematics 3rd Ed under the counting and choosing chapter. It is a multipart question and I am stuck on the last part:

'The digits 1 2 3 4 5 6 are written in some order to form a six digit number'.

...

d) How many are divisible by $8$? (Hint: first show that the remainder on dividing a six digit number $abcdef$ by 8 is $4d + 2e + f$)

I know there are 720 different permutations from a previous question, and I realised that only the last three digits affect divisibility by 8 as $8 * 125 = 1000$, so the final answer will be $3!x$ where $x$ is the number of permutations of the last three digits that are divisible by 8.

In terms of the hint it was simple to use long division to establish $\frac{100d + 10e + f}{8} = 12d + e$ with a remainder $4d + 2e + f$. For this remainder to be divisible by 8, I can see that $f$ must also be even. I just can't make the last step, can anyone please give me a hint (would prefer not to be given the actual answer if possible!).