# Fixed sum of combinations

1. Nov 28, 2013

### MartinV05

When you have combinations where digits are 0,1,2...,m, meaning we have n=m+1 and k, is there a way to see how much of them sum up to a given number? For the sake of simplicity I have the digits 0,1,2...,7 (so n=8), and k=3. I need to find how much of these combinations WITH repetition sum up to 7. Is there a formula for this?

2. Nov 28, 2013

### MartinV05

By sum up, I mean the sum of all 3 digits in each combination needs to be equal to 7.

3. Nov 29, 2013

### Stephen Tashi

I don't know a formula, but there is a procedure - or at least a concise way to phrase the problem.

Compute

$(1 + x + x^2 + x^3 +x^4 + x^5 + x^6 + x^7)^3 = ?$

and then look at the coefficient of $x^7$ in the answer. The coefficient counts the number of permutations of the numbers 0,1,2...7 that add to 7. To get combinations, divide that by $3!$.