# Combinatorics question involving summing digits of numbers

• Jan 29th 2011, 06:38 AM
CuriosityCabinet
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!
• Jan 29th 2011, 06:52 AM
Plato
Quote:

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?
• Jan 29th 2011, 07:00 AM
CuriosityCabinet
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.
• Jan 29th 2011, 07:06 AM
Plato
Quote:

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.
• Jan 29th 2011, 07:12 AM
CuriosityCabinet
Quote:

Originally Posted by Plato
I used a generating function and it gave the same answer.

Can you explain to me your method?
• Jan 29th 2011, 07:21 AM
Plato
Quote:

Originally Posted by CuriosityCabinet
Can you explain to me your method?

One expands $\left( {\sum\limits_{k = 1}^9 {x^k } } \right)\left( {\sum\limits_{k = 0}^9 {x^k } } \right)^4$.

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

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

Here is an online tool you can use.