mixed factorial sum in loops

I need to do a mixed factorial sum, using loops, to calculate: 1! x (5^max) + 2! x (5^(max-1)) + 3! x (5^(max-2)) + 4! x (5^(max-3)) + ... + max! x (5^1)

(Example using max = 4, but needs to do it with any number)

I can't seem to be able to get the simple factorial loop right when adding in the secondary loop.

Test case: max = 4, Answer = 1145

Please, pretty please, help me?
Can't help much without looking at the code.
Topic archived. No new replies allowed.