# Thread: Combinatorics question involving summing digits of numbers

1. ## Combinatorics question involving summing digits of numbers

How many five-digit numbers are there who digits sum to 39?

Can someone give me their answer so I can check if mine is right? Thank you!

2. Originally Posted by CuriosityCabinet
Can someone give me their answer so I can check if mine is right? Thank you!
Why not post your answer as well as the method used to get it?

3. The different digit combinations possible are of the form:
99993
99984
99975
99885
98886
99966
88887
99876
99777
98877

Then I worked out how many combinations of each digit there are and summed it, to get 210. But have a feeling that isn't quite right.

4. Originally Posted by CuriosityCabinet
The different digit combinations possible are of the form:
Then I worked out how many combinations of each digit there are and summed it, to get 210. But have a feeling that isn't quite right.
I used a generating function and it gave the same answer.

5. Originally Posted by Plato
I used a generating function and it gave the same answer.
Can you explain to me your method?

6. Originally Posted by CuriosityCabinet
Can you explain to me your method?
One expands $\displaystyle \left( {\sum\limits_{k = 1}^9 {x^k } } \right)\left( {\sum\limits_{k = 0}^9 {x^k } } \right)^4$.

The coefficient of $\displaystyle x^{39}$ is the answer.

Notice the first sum starts at $\displaystyle k=1$ because the first digit in a five digit number cannot be zero.

Here is an online tool you can use.