<s>[INST] $\underbrace{\sum_{x = 1}^{r} \ldots \sum_{x = 1}^{r}}_{\text{n times}} x = ?$ Let $f(n,r) = \sum_{x = 1}^{r} f(n - 1,x)$ with $f(0,x) = x$.
We get
$$f(n,r) = \underbrace{\sum_{x_{n-1} = 1}^{x_n = r} \ldots \sum_{x = 1}^{x_1}}_{\text{n times}}x\text{ .}$$
This sum popped up when I was trying to find a formula for the numbers in Pascal's triangle and I have no idea about solving it.
I tried figuring out the first sum $f(1,r)$ and it is the triangular number $\frac{r(r + 1)}{2}$ and tried figuring out the second sum $f(2,r)$ in terms of the first by naming $\frac{r(r + 1)}{2}$ as $F(r)$:
$
\begin{eqnarray}
f(2,r)&=& \sum_{x_1 = 1}^{r}\color{blue}{\sum_{x = 1}^{x_1} x} \\
&=& \sum_{x_1 = 1}^{r} \color{blue}{\frac{x_1(x_1+1)}{2}} \\
&=& \frac{1}{2} \sum_{x_1 = 1}^{r} x_1(x_1 + 1) \\
&=& \frac{1}{2}(2 + 6 + 12 + \ldots + r(r + 1)) \\
&=& \frac{1}{2}((2 + (2 + 2 \cdot 2) + \ldots + r(r + 1)) \\
&=& \color{green}{\frac{1}{2}}(\color{green}{2}(1) + \color{green}{2}(1 + 2) + \ldots + \color{green}{2}(1 + 2 + \ldots + r)) \\
&=& (1) + (1 + 2) + \ldots + (1 + 2 + \ldots + r) \\
&=& \color{blue}{r(1 + 2 + \ldots + r)}\color{purple}{- ((r-0) + (r - 1) + \ldots + 2)} \\
&=& \color{blue}{\frac{r^2(r + 1)}{2}} \color{purple}{- r(r - 1) + \frac{(r - 1)(r - 2)}{2}} \\
&=& rF(r) - 2F(r - 1) + F(r - 2) \\
&=& rF(r) - 2(F(r) - r) + (F(r) - (r + (r - 1))) \\
&=& rF(r) - 2F(r) + 2r + F(r) - 2r + 1 \\
&=& rF(r) - F(r) + 1 \\
&=& (r - 1)F(r) + 1 \end{eqnarray}
$
After getting a formula for $f(n,r)$ in terms of $f(1,r)$, you swap $r$ for $x$ to get a sum $f(n + 1,x)$ that runs from $1$ to $r$, then you find a formula for $f(n + 1,r)$ in terms of $f(1,r)$ and swap to get $f(n+2,r)$ and so on, at least this was how the sum was defined in the context of my work on the formula for the numbers of Pascal's triangle.
For example:
$$\begin{eqnarray} f(1,r) &=& \sum_{x = 1}^{r} x \\
&=& \frac{r(r + 1)}{2} \\
&=& F(r) \\ \\
f(2,r) &=& \sum_{x = 1}^{r} F(x) \\
&=& (r - 1)F(r) + 1 \\
&=& G\circ F(r) \\ \\
f(3,r) &=& \sum_{x = 1}^{r} G\circ F(x) \end{eqnarray}$$
I don't know if their exists such a formula in terms of the first sum for any number of sums we take, I stopped to see if there is any easier way to solve it.
 [/INST] There is a somewhat combinatorial approach to this problem that uses hockey-stick identity.
Note that $f(0,x)=\binom{x}{1}$. We have that
$$f(1,r)=\sum_{x=1}^r \binom{x}{1}$$
Using hockey-stick identity, this is
$$f(1,r)=\binom{r+1}{2}$$
We are motivated to proceed by induction. We hypothesize that $f(n,r)=\binom{r+n}{n+1}$. We have already established our base case. To prove our inductive step, we want to prove, given $f(n-1,r)=\binom{r+n-1}{n}$, that
$$f(n,r)=\binom{r+n}{n+1}$$
Since we have the recursion
$$f(n,r)=\sum_{x=1}^r \binom{x+n-1}{n}$$
By hockey-stick identity, this simplifies to
$$\binom{r+n}{n+1}$$
Hence, our proof by induction is complete.
</s>