Show that the sum of the first $n$ triangular numbers is $n$($n + 1$)($n + 2$)/6
3 Answers
Consider all digrams taken from an $n+1$ letters alphabet $abc\cdots no$, such that the letters are in order and group them by the first letter:
$$ab,ac,ad,\cdots ao,\\bc,bd,\cdots bo,\\cd\cdots co,\\\vdots\\no.$$
The total number of digrams equals $n+(n-1)+(n-2)+\cdots 1$, which is a triangular number. At the same time, it is the number of ways to pick two letters from a set of $n+1$, regardless the order, and
$$n+(n-1)+(n-2)+\cdots 1=\binom{n+1}2=\frac{(n+1)n}{2!}.$$
You can easily generalize to trigrams from the $n+2$ alphabet $abc\cdots op$ and get
$$\frac{(n+1)n}{2!}+\frac{n(n-1)}{2!}+\frac{(n-2)(n-3)}{2!}+\cdots 1=\binom{n+2}3=\frac{(n+2)(n+1)n}{3!}.$$
More generally,
$$\#(k,n+k-1)\text{-grams}=\sum_{i=1}^{n}\#(i,n+k-2)\text{-grams}=\binom{n+k-1}k.$$
When you already have the formula for the sum, it suffices to subtract for $n$ and $n-1$:
$$\frac{n(n+1)(n+2)}6-\frac{(n-1)n(n+1)}6=\frac{n(n+1)((n+2)-(n-1))}6=\frac{n(n+1)}2.$$
(Just the difference of consecutive triangular numbers is $n$.)
A different approach based on differences and Leibniz's notation used for finite differences is to define the difference operator $d$ for a function $f(n)$ given by $$ df=f(n)-f(n-1) $$ Then we have $$ \begin{array}{|c|c|c|c|c|} \hline f(n)&1&n&n^2&n^3\\ \hline df&0&1&2n-1&3n^2-3n+1\\ \hline \end{array} $$ together with the rules $d(kf)=k(df)$ and $d(f+g)=df+dg$. From this we can derive rules going in the opposite direction: $$ \begin{align} df&=n^2\\ &=(n^2-n+\tfrac13)+(n-\tfrac12)+\tfrac16\\ &=\tfrac13 d(n^3)+\tfrac12 d(n^2)+\tfrac16 d(n)+c\cdot d(1) \end{align} $$ with initial value $f(0)=0$ showing that $f(n)=\sum k^2=\tfrac13n^3+\tfrac12n^2+\tfrac16n$ and similarly $$ \begin{align} dT&=n\\ &=(n-\tfrac12)+\tfrac12\\ &=\tfrac12 d(n^2)+\tfrac12 d(n)+c\cdot d(1) \end{align} $$ with initial value $T(0)=0$ showing us that $T(n)=\sum k=\tfrac12n^2+\tfrac12 n$. Then we are looking for $f(n)=\sum T(k)$ which has $$ \begin{align} df&=f(n)-f(n-1)\\ &=T(n)\\ &=\tfrac12n^2+\tfrac12 n \end{align} $$ and again we have $f(0)=0$. Thus $f(n)=\frac12\sum n^2+\frac12\sum n=\tfrac13n^3+\tfrac12n^2+\tfrac23n$.

- 18,395