Solution of the Week #487 - How Many Ways

Obviously the final digit needs to be a 5. For the first two digits to be divisible by 3, they simply need to sum to a multiple of 3. Without the 5 there are three ways (1,2; 2,4; 3,6) and their reversals.

For the third and fourth digits to make a number divisible by 4, either the fourth digit is a multiple of 4 and the third digit is even, or the fourth digit is an even number not divisible by 4 and the third digit is odd. The fifth digit is whatever is left. Since at least one of the remaining three numbers will be odd, we have the same situation as before where if one arrangement is possible, a second is also possible. (See POTW #484).

So overall we have 3 pairs for the first two digits, doubled as they can be reversed, and doubled again for the remaining three digits.

12 possibilities in all:

126435

123645

216435

213645

241635

243615

421635

423615

361245

362415

631245

632415