# Find the sum of all 4-digit numbers formed by using the digits 1, 2, 3, 4, 5

...and where no digit is to be repeated in any 4-digit number.

Yes, I am aware of similar questions on this site, but none of the answers gave me insight as to how this works.

I would like an answer in ridiculously simple terms, like explaining it to a 5 year old.

Total numbers formed using those 5 digits is 5P4. i.e. 120 numbers.

Since all digits will equally occupy the unit's place, therefore 1 will occur 24 times in unit's place. Similarly 2 will occur 24 times in unit's place. So on and so forth. Therefore sum of all digits in unit's place will be equal to 24 x (1+2+3+4+5)=24 x 15.

Similarly sum of all digits in ten's place will be equal to 24 x 150.

Therefore total sum of all numbers =24 x (15+150+1500+15000)=399960 .

Why is there the sum (1 + 2 + 3 + 4 + 5)? Am I misreading the question? Does "no digit is to be repeated in any 4-digit number" mean that there shouldn't be a number like 4432, or does it mean that a number should not be repeated in the same "unit slot"?

• When it says no digit is to be repeated in any 4 digit number, it means 4432 would not be valid, since there are two 4s in the number (all digits in a number should be unique). – user2825632 Sep 8 '16 at 17:39
• Yeah, I thought so. But I couldn't figure out for the life of me how one got (1 + 2 + 3 + 4 + 5). It seemed to me that you could only do that if you would know that those are the only numbers that would fit into a "unit slot". With unit slot I mean the unit place, the tens place, the hundreds place, etc. – Garth Marenghi Sep 8 '16 at 17:41
• The point the answer you share is trying to make, is that if we were to write out the list of all of the answers in a grid, instead of adding each row at a time, we may instead add each column at a time. In the same way that it is useful to think of $247 + 132$ instead as $\begin{matrix}&2&4&7\\+&1&3&2\end{matrix}$, adding column by column. In this specific problem, there will be 120 rows in our addition and five columns. We notice that in each column, the numbers 1,2,3,4,5 each occur equally often, i.e. there are 24 1's in the first column as well as 24 2's, 24 3's, etc... – JMoravitz Sep 8 '16 at 17:44
• The sum of the $120$ digits in the units column is $24\times 1 + 24\times 3 + 24\times 3 + 24\times 4 + 24\times 5$. Then factor out the $24$ – Henry Sep 8 '16 at 17:44
• @JMoravitz This! This is the one that made the quarter drop (a saying in my language, Dutch). I understand! I finally understand! You brought a tear to my eye, my friend! (Also thanks to everyone who commented ;-)) – Garth Marenghi Sep 8 '16 at 17:50

Your answer is trying to say that when you write out all 120 numbers, it will look something like this:

1234

1235

...

2134

2135

...

5123

5124

There will be 24 ones in the thousands place, 24 twos in the thousands place, etc. This is because once we set a certain number in the thousands place (e.g. one), then we have 24 distinct four digit numbers.

So we calculate the sum of the 120 valid 4 digit numbers by first looking at the sum of the digits in the thousands place. This sum is $$1000 * 24 * 1 + 1000 * 24 * 2 + 1000 * 24 * 3 + 1000 * 24 * 4 + 1000 * 24 * 5$$

The 1000 comes from looking at the sum of the digits in the thousands' place. The solution you provided factored this result as $1000 * 24 * (1+2+3+4+5)$.

Now that we've calculated the sum of the digits in the thousands' place, we can do the same for the hundreds' place, tens' place, and ones' place similarly:

Hundreds' Place: $100 * 24 * (1+2+3+4+5)$

Tens' Place: $10 * 24 * (1+2+3+4+5)$

Ones' Place: $1 * 24 * (1+2+3+4+5)$

• Yeah, this is exactly it. As you could probably see, someone provided in the comment section on my question the key idea that finally made it click. Your answer clarified it even more, so, thank you! – Garth Marenghi Sep 8 '16 at 17:57

It's just a shorthand for adding up the $120$ possible values of the ones place.

The digit $1$ occurs $24$ times, as does $2, 3, 4,$ and $5$,

If your digits were $(2,4,5,7,9)$ then the sum would be $24 \times (2+4+5+7+9)$.

• Thank you for providing an answer. The key had come already in a comment I got, but this solidifies it further. Thanks! – Garth Marenghi Sep 8 '16 at 17:56