It'll be easier to take an example to show this.
Take for instance three numbers, 1, 3 and 7.
Now if we start thinking about all the ways the number can be arranged, we find that if we put a number say 3 in the tens position we can only keep it there as long as the other number are changing. Or in other words, 3 can only be in the tens place as long as 1 and 7 and moving around. And 1 and 7 can only move around in 2 ways or more accurately 2! ways. This will make more sense when we use our example down below.
If we try and list down all the possible three digit number it can form, it'll be something like.
137
173
317
371
713
731
Here if we follow what we talked about earlier, we'll see that for each number in a position, it'll be there only 2 times. And if this is consistent it will form a pattern in each row.
So if we look at each row, the sum of all numbers will be the same.
As we found that in this case, a number will be there 2! times, we can write down a formula to find the sum of the numbers in each row, using the following logic,
- each number will be there two times exactly
- sum of those numbers will be that number x 2 (1x2, 3x2, 7x2)
- total sum will be 1x2+3x2+7x2 or 2(1+3+7) or 2!(1+3+7) or in a general manner (n-1)!(sum of numbers)
so we've figured out the sum of each row. Now each row is different in terms of its position (ones, tens, hundreds) so when we add it will be like this.
0022
022-
22--
if we simplify this -> 22x1+22x10+22x100
taking 22 out -> 22(1+10+100) or 22(111)
so putting everything together we'll get
2!(1+3+7)(111) or generally
(sum of numbers) x (n-1)! (11111... n times)