Let the number be 10000A+1000B+100C+10D+E, where the A-E range from 1-9.
The first task is to find a representation for the sum of all the permutations. Each digit appears 12 times on the 100s digit, 12 times on 10s digit, and 12 times on the 1s digit. To see this, consider the number A _ _. There are 4*3 ways of filling it in with the remaining 4 digits. This means that the the total for all permutations would be
100*12*(A+B+C+D+E)+10*12*(A+B+C+D+E)+12*(A+B+C+D+E)
=1332*(A+B+C+D+E)
Setting this equal to the original number and simplifying the result yields
8668A = 332B + 1232C + 1322D + 1331E
The largest the right side can be is 33171 (B=6,C=7,D=8,E=9) which means that A is less than or equal to 3. Similarly the smallest the right side can be is 8999 which means that A has to be 2 or larger. This narrows A down to 2 or 3.
Also, the coefficients in front of A, B, and C are divisible by 4. Since the one in front of D is divisible by 2 and the one in front of E is odd, this means that (D,E) has to be one of the following (odd,2), (odd,6), (2,8), (2,4), (6,8), or (6,4).
I don't know if there can be more elimination from this point on. So I resorted to trying out the different possibilities and then simplifying.
Case 1, A=3, D=odd, E=2
12671 = 116B + 616C + 661D
This is impossible since the right side is maxed at 11689.
Case 2, A=2, D=odd, E=6
4675 = 116B + 616C + 661D
D cannot be larger than 5 or the right side would be too large.
Trying D=1 and D=3 does not yield a solution.
Case 3, A=3, D=odd, E=6
9009 = 116B + 616C + 661D
D has to be at least 4 or the right side would be too small. Trying D=5, D=7, D=9 does not yield a solution.
Case 4, A=3, D=2, E=8
3178 = 83B + 308C
C has to be 8 or 9 otherwise the right side would be too small. Trying either does not yield a solution.
Case 5, A=3, D=2, E=4
4509 = 83B + 308C
This is impossible since the right side is capped at 3436.
Case 6, A=2, D=6, E=8
-311 = 83B + 308C
Impossible.
Case 7, A=3, D=6, E=8
1856 = 83B + 308C
C has to be between 4 and 6. None of them yields a solution.
Case 8, A=2, D=6, E=4
1020 = 83B + 308C
C has to be 3 or less. No solution still.
Case 9, A=3, D=6, E=4
3187 = 83B + 308C
C has to be 8 or 9. It turns out that C=9 works with B=5.
After all that, the answer comes down to A=3, B=5, C=9, D=6, E=4. So the number is 35964! |