We have the following nice problem: Search for all vectors $(x_1,\ldots,x_r)$ with $x_i > 0$ that satisfy
$$ x_1+x_2+x_3+\cdots+x_r \leq n $$
$\textbf{discussion}$
One approach I have in mind is as follows: First, consider solutions to $\sum^r x_i = n$ and we know there are ${n-1 \choose r-1}$ such solutions by stars and bars argument. but, before we continue, for this argument to work we must have $n \geq r$. Now, we count how many vectors satisfy $\sum x_i = n-1$ and we know again there are ${n-2 \choose r-1}$ such vectors. If we keep this process down to $r$, that is, if we try to find solutions to $\sum x_i = r $, then we obtain just one $(1,1,1,\ldots,1)$ or ${r-1 \choose r-1}$. Therefore, in total we have
$$ {n-1 \choose r-1 } + {n-2 \choose r-1} + {n-3 \choose r-1} + \cdots + {r-1 \choose r-1} $$
such vectors. Is there a way to simplify this expression? Is there any other approach to tackle this problem?
Suppose that you want to count the subsets of $[n]=\{1,\ldots,n\}$ of size $r$. One way to count them is to divide them up according to the largest number in the subset. If $k$ is the largest number in the subset, there are $\binom{k-1}{r-1}$ ways to choose the $r-1$ smaller numbers in the subset, so there are $\binom{k-1}{r-1}$ subsets of $[n]$ of size $r$ whose largest element is $k$. The possible choices for $k$ range from $r$ through $n$, so $[n]$ has
$$\sum_{k=r}^n\binom{k-1}{r-1}$$
subsets of size $r$. Of course we know that it has $\binom{n}r$ subsets of size $r$, so
$$\sum_{k=r}^n\binom{k-1}{r-1}=\binom{n}r\,;$$
that’s your closed form. This is the hockey stick identity; it comes up a lot and is worth knowing.