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.
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.
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