# Sum of all numbers formed by the given digits

The formula for sum of all numbers formed with all the given digits is:

(Sum of digits) (n-1)!(1111....ntimes)


n stands for number of digits.

For ex: Sum of all numbers formed with 1,2,3 and 4 is 10 × 3! × 1111 = 66660.

Can anyone figure out how this was derived?

I figured the answer out.

If you fix 1 in the thousands place, all other numbers can be arranged in 3! Ways.

Therefore 1 occurs in thousands place 3! Times. Same for all the numbers. Therefore for thousands place, total sum= 1000(sum) 3!.

But same thing occurs for all other positions. Therefore sum= 1111...×(sum) ×(n-1)!

• This is correct. It works as long as the digits are distinct and either none of them is zero or you include numbers starting with zero. So if the digits were $0,1,2,3$ you would have to include $0123$ and $0312$ in your sum. If the digits have a match, like $1,2,3,3$ you have fewer numbers as swapping the $3$'s doesn't produce a new number. Dec 11 '15 at 15:04

This can also be done in another method — we get 10 if we add the digits 1,2,3,4. 4! is 24 and the number of digits is 4 so, if we divide 24 by 4 we get 6. 10×6=60. 60 will be taken in all ones tens, hundreds, thousands, ten thousands... if we add in this method we get the answer as 66660.

As total arrangements will be n factorial and there are n numbers.So each no. can occupy a place (n factorial/n) times then to get sum at a particular place value you have to multiply it with that place value and of course the digit. So doing it for all place values will give you a term (1111...n times) and also (sum of all digits in process) plus this all is occuring (n factorial/n) times or n-1 factorial times so take the product and there you get the result.