How Many Combinations of Digits 0-7 Sum to 7?

  • Level: Undergrad 
  • Thread starter Thread starter MartinV05
  • Start date Start date
  • Tags Tags
    Combinations Sum
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
2 replies · 3K views
MartinV05
Messages
23
Reaction score
0
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?
 
Physics news on Phys.org
By sum up, I mean the sum of all 3 digits in each combination needs to be equal to 7.
 
MartinV05 said:
Is there a formula for this?

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

Compute

[itex](1 + x + x^2 + x^3 +x^4 + x^5 + x^6 + x^7)^3 = ?[/itex]

and then look at the coefficient of [itex]x^7[/itex] 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 [itex]3![/itex].