# Calculate sum of all numbers obtained from permutations of the following digits

I want to master my skills in elementary combinatorics so trying to solve the following problem: Calculate sum of all $10$-digit numbers obtained from all possible permutations of $\{4,5,5,6,6,6,7,7,7,7\}$.

How many times does each number from the list appears in every digit? (English is not my native language so I'm afraid of using wrong terminology, by digits here I mean units, dozens, hundreds, thousands and so on in decimal representation) For $4$ it $9!$ times since when we fix it somewhere we are free to vary all other positions and there are $9!$ such possibilities. Similarly for $5$ we have $2\cdot9!$ because of there are two $5$'s in our list, for $6$ there are $3\cdot9!$ and $7$ appears $4\cdot9!$ times in each digit.

What is the sum of all such numbers restricted to particular digit? It is $4\cdot1\cdot9! + 5\cdot2\cdot9! + 6\cdot3\cdot9! + 7\cdot4\cdot9! = 21772800$.

Now we are ready to calculate the final answer by sum in all digits: $\sum\limits_{i=0}^{9} 21772800\cdot 10^i = 24191999997580800$.

Am I right or are there any mistakes?

Another way to obtain it is to simply note that the average of the $10$ digits $\{4,5,5,6,6,6,7,7,7,7\}$ is $6$, and $6 666 666 666$ ($10$ digits all equal to $6$) times $10!$ (the number of possible permutations) equals $24191999997580800$.
• I realized that we both gave wrong solutions since there are only four unique digits in the list, so different permutations may correspond to the same numbers. Just to be more precise, the true answer is $6666666666\cdot\frac{10!}{2!3!4!} = 83999999991600$. – Hasek Feb 27 '17 at 15:34