<s>[INST] Computation of a sum $S(n)$ We have the following sum:
$ \forall \; n \in \mathbb{N} \setminus \{0, 1 \} $ we define:
\begin{equation*}
\begin{split}
S(n) & = (1 \times 2) + (1 \times 3) + \dots + (1 \times n) \\
 & + (2\times3) + (2 \times 4) + \dots + (2 \times n)  \\
 & + ... \\
 & + (n - 2) \times (n- 1) + (n - 2) \times n \\
 & + (n - 1) \times n 
\end{split} 
\end{equation*}
What I've done so far? 
Well, I consider only the first line and obtain $\dfrac{1}{2}$ $(n^2 + n - 2)$, considering the second line I get $(n^2 + n - 6)$. The sums of the last two lines are $(n-2)(2n-1)$ and $n(n-1)$. 
So far, so good. But I don't see how to calculate the whole sum. Can anyone give me a hint?
 [/INST] After using distributivity I get:
\begin{equation*}
\begin{split}
S(n) & = 1 \times (2 + 3 + 4 + \dots + n) \\
 & + 2 \times (3 + 4 + 5 + \dots + n)  \\
 & + 3 \times (4 + 5 + 6 + \dots + n) \\
 & + 4 \times (5 + 6 + 7 + \dots + n) \\
 & + \dots
\end{split} 
\end{equation*}
I can rewrite this as:
\begin{equation*}
\begin{split}
S(n) & = \dfrac{1}{2} \ (n^2 + n - 2) & = \dfrac{1}{2} \ (n+2)(n-1)  \\
 & + \dfrac{2}{2} \ (n^2 + n - 6) & = \dfrac{2}{2} \ (n+3)(n-2)  \\
 & + \dfrac{3}{2} \ (n^2 + n - 12) & = \dfrac{3}{2} \ (n+4)(n-3)    \\
 & + \dfrac{4}{2} \ (n^2 + n - 20) & = \dfrac{4}{2} \ (n+5)(n-4)  \\
 & + \dots
\end{split} 
\end{equation*}
Is this right so far? I still don't see how to get the formula for the sum $S(n)$
</s>