Fixed sum of combinations When you have combinations where numbers are $0,1,2,\dots,m$, meaning we have $n=m+1$ and $k$, is there a way to see how $k$ of them sum up to a given number? 
For the sake of simplicity I have the numbers $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$. By sum up, I mean the sum of all $3$ digits in each combination needs to be equal to $7$. 
Is there a formula for this?

Write $m$ as 
$$\underbrace{1 + 1 + 1 + 1 + 1 + \cdots + 1 + 1}_{\text{m 1s}}$$
This isn't the only sum, however. Other possible sums are $$3 + 3 + \underbrace{1 + 1 + 1 + 1 + \cdots + 1 + 1}_{\text{m-6 1s}}$$ or $$2 + 1 + \underbrace{1 + 1 + 1 + 1 + \cdots + 1 + 1}_{\text{m-5 1s}} + 2$$ Notice, however, if we decompose all our non-unit integers into ones, they all end up as $$\underbrace{1 + 1 + 1 + 1 + 1 + \cdots + 1 + 1}_{\text{m 1s}}$$ In other words, we can represent $3 + 3 + \underbrace{1 + 1 + 1 + 1 + \cdots + 1 + 1}_{\text{m-6 1s}}$ as $$(1 + 1 + 1) + (1 + 1 + 1) + \underbrace{1 + 1 + 1 + 1 + \cdots + 1 + 1}_{\text{m-6 1s}}$$
and $2 + 1 + \underbrace{1 + 1 + 1 + 1 + \cdots + 1 + 1}_{\text{m-5 1s}} + 2$ as $$(1 + 1) + (1) + \underbrace{1 + 1 + 1 + 1 + \cdots + 1 + 1}_{\text{m-5 1s}} + (1 + 1)$$
Instead of using parenthesis, let us re-write this as 
$$1 + 1 \ \Big\vert \ + 1 \ \Big\vert + \underbrace{1 + 1 + 1 + 1 + \cdots + 1 + 1}_{\text{m-5 1s}}  \ \Big\vert + 1 + 1$$
and re-write the other sum as  $$1 + 1 + 1 \ \Big\vert + 1 + 1 + 1 \ \Big\vert + \underbrace{1 + 1 + 1 + 1 + \cdots + 1 + 1}_{\text{m-6 1s}}$$
Notice that every single sum can be represented with such "bar notation". For sums with zeroes, such as $3 + 0 + 2 + 5$, we could write $$ 1 + 1 + 1 \ \Big\vert \ \Big\vert + 1 + 1 \ \Big\vert + 1 + 1 + 1 + 1 + 1$$ (there are no ones in between the first two bars) and for sums such as $0 + 0 + 0 + 1 + 1 + 2 + 3$ we could do $$ \ \Big\vert \ \Big\vert \ \Big\vert 1 \ \Big\vert + 1 \ \Big\vert + 1 + 1 \ \Big\vert + 1 + 1 + 1$$
as there is nothing to the left of the first divider, representing the first zero, nothing in between the first two dividers, and nothing in between the second and third dividers.
So suppose we have $k$ summands. This would require $k-1$ bars, just as $1 \ \Big\vert + 1 \ \Big\vert + 1$  requires two bars instead of three. There are $m$ ones, which must be arranged with the $k-1$ bars. Therefore, in total, there are $\dbinom{m + k - 1}{m}$ ways to do the arrangement.
