# Sum of all four digit numbers with digits 0,1,2,3,4 with no repeating digits

What is the sum of all 4-digit numbers with the digits $0,1,2,3,4$ with no digits repeating in each number?

Im wondering if there are any ways to do this without listing all the numbers.

• Would you be able to find the sum of all possible combinations of numbers with 0,1,2,3,4 with no repeats? (basically the same as your question but you can use 0 as the first digit) – suomynonA Oct 14 '16 at 2:11

## 1 Answer

Let's pretend that $0$ can be the first digit. Then, there would be $5 \cdot 4\cdot3\cdot2\cdot1=120$ possible combinations. Every digit is at the same place the same number of times, so the sum of all these combinations is $$\color{red}{(0+1+2+3+4)}\cdot \color{blue}{\dfrac {120}5} \cdot \color{green}{1111}=266640$$

Then, you can subtract the sum of the numbers with $0$ as the first digit. There are $4 \cdot 3 \cdot 2=60$ such numbers, so the sum is $$\color{red}{(1+2+3+4) }\cdot \color{blue}{\dfrac{24}4} \cdot \color{green}{111} = 6660$$ Now, to find the answer, you can just subtract the two numbers, getting $$266640-6660=259980$$

Explanation for how the color coded equations:

$\color{red}{Red}$ - Sum of all the digits
$\color{blue}{Blue}$ - Number of ways to rearrange divided by number of digits
$\color{green}{Green}$ - Multiply to account for place value

• How did you get the first two centered equations? – joonoon Oct 14 '16 at 2:22
• @joonoon See my edits – suomynonA Oct 14 '16 at 2:33
• Wow... smart solution. Thanks @suomynonA – joonoon Oct 14 '16 at 2:35