Find the sum of all distinct four digit numbers that can be formed using the digits $1,2,3,4,5$, each digit appearing at most once.
The answer is 399960. For each $x \in \{ 1,2,3,4,5 \}$, there are $4 !$ such numbers whose last digit is $x$. Thus the digits in the unit place of all the 120 numbers add up to $4 ! ( 1 + 2 + 3 + 4 + 5 )$. Similarly the numbers at ten's place add up to 360 and so on. Thus the sum is $360 ( 1 + 10 + 100 + 1000 )$.
Find the sum of all distinct four digit numbers that can be formed using the digits $1,2,3,4,5$, each digit appearing at most once.