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.

  • $\begingroup$ 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) $\endgroup$ – suomynonA Oct 14 '16 at 2:11

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.