Finding the formula for the number of golf balls in a triangular pyramid with $n$ layers. 
Toni and her friends are building triangular pyramids with golf balls.
  Write a formula for the number of golf balls in a pyramid with n
  layers, if a $1$-layer pyramid contains 1 ball, a 2-layer pyramid contains 4
  balls, a 3-layer one contains 10 balls, and so on.

What is the formula for this question, and what are the steps involved in deriving it? 
 A: If it is a square pyramid, the length of the side of each level will increase by one each time you go down.  Thus the number of balls on each level is $k^2$.  Therefore the total number of balls with $n$ levels is $\sum\limits_{k=1}^n k^2$
In simplifying this it becomes the Square Pyramidal Number which is $\frac{n(n+1)(2n+1)}{6}$
If it is a tetrahedron, the length of the side of each triangle on each level will increase by one each time you go down.  Thus the number of balls on each level is $T(k)$, the $k^{th}$ triangle number.  Thus the total number of balls with $n$ levels is $\sum\limits_{k=1}^n T(k)$
In simplifying this, it becomes the $n^{th}$ Tetrahedral Number, $\frac{n(n+1)(n+2)}{6}$

The derivation of the square pyramidal number is outlined in the wiki article linked.  To prove the derivation of the tetrahedral number, first note that $T(k) = \sum\limits_{i=1}^k i = \frac{k(k+1)}{2}$, where $T(k)$ denotes the $k^{th}$ triangle number.
So, the $n^{th}$ tetrahedral number is $\sum\limits_{k=1}^n T(k) = \sum\limits_{k=1}^n \frac{k(k+1)}{2} = \frac{1}{2}\sum\limits_{k=1}^n k^2 + k = \frac{1}{2}(P(n)+T(n))$ where $P(n)$ denotes the $n^{th}$ pyramidal number.
This then simplifies to $\frac{1}{2}(\frac{n(n+1)(2n+1)}{6} + \frac{n(n+1)}{2})$ which after some algebra simplifies to the formula given earlier.

To find the triangle number, $T(n)$, this is $1+2+3+\dots+(n-1)+n$.  At the moment we do not know what the total is as we are coming up with a formula for it.  Suppose that we give the total a name, $T(n)$.  Then $T(n)=1+2+3+\dots+(n-1)+n$.
We try multiplying it by two to see what happens.
$2T(n)=2(1+2+3+\dots+(n-1)+n)$
$= (1+2+3+\dots+(n-1)+n) +(1+2+3+\dots+(n-1)+n)$
$=(1+2+3+\dots+(n-1)+n) +(n+(n-1)+\dots+3+2+1)$ by reversing the order of the second parenthesis
$=(1+n)+(2+(n-1))+\dots+((n-1)+2)+(n+1)$ by grouping terms together as they appear in the parenthesis.
$=(n+1)+(n+1)+\dots+(n+1) = n(n+1)$
Remembering this was the total for $2T(n)$, we divide by two to get
$T(n)=\frac{n(n+1)}{2}$
A: Each layer is a triangular number $\binom n2=\frac{n(n-1)}2 = \sum_{i=0}^{n-1}i$, where the side of the triangle contains $n-1$ balls. Note that the second equality is a special case of the general identity
$$
  \sum_{i=0}^{n-1}\binom ik =\binom n{k+1}
$$
which can be proved by an easy induction using Pascal's recurrence $\binom nk+\binom{n-1}k=\binom n{k+1}$. Applying it for $k=2$ gives
$$
  \sum_{i=0}^{n-1}\binom i2 =\binom n3
$$
which is the number of balls in a tetrahedral pyramid with side $n-2$. So the number you are after is $$\binom{n+2}3=\frac{n(n+1)(n+2)}6.$$
Generalising, then number in dimension $d$ is $\binom{n+d-1}d$. Since that number is well known to count the $d$-multisets on an $n$-elements set (that is, ways to select $d$ elements out of a total of$~n$ with multiple selection of a same element allowed), one might ask if there is a way to uniquely label the golf balls with such multisets. Here is a way to do it. Arrange the multiset as $(c_1,\ldots,c_d)$ in weakly decreasing order, so that one has $n\geq c_1\geq c_2\geq\cdots\geq c_d>0$; then let $c_1$ select the size of the "layer" on the outer level, and let $(c_2,\ldots,c_d)$ recursively select agolf ball in this $d-1$-dimensional layer.
