TITLE: What is the sum of products of pairs of integers: $\sum_{0\le i<j\le n} ij$?
QUESTION [6 upvotes]: It is well known that $S_1\equiv \sum_{k=0}^n k = \binom{n+1}{2}$. How is this formula generalized for sums of products of pairs of integers smallest than $n$?
In the simplest case, this is
$$S_2 \equiv \sum_{0\le i<j\le n}ij = \frac12 \left(\sum_{i,j=0}^n ij - \sum_{i=0}^n i^2\right).$$
I can rewrite this as
$$S_2 = \sum_{i=1}^n i \sum_{j=i+1}^n j
= \sum_{i=1}^n i \left[\binom{n+1}{2}-\binom{i+1}{2}\right].$$
Is there a more explicit formula for this? Or maybe a more direct or geometrical argument to get to this?
More generally, are there formulae for
$S_k\equiv \sum_{0\le i_1<...<i_\ell\le n}i_1\cdots i_\ell$?
One context in which these numbers arise is in the coefficients of $s!/(s-k)!$ with $k\le s$:
$$\frac{s!}{(s-k)!} = \sum_{j=0}^k S_k s^k.$$

REPLY [5 votes]: If you go one step further in your first line, then you can write this as
$$ S_2 = \frac{1}{2}(\sum_{i=0}^n i)^2 - \frac{1}{2}\sum_{i=0}^n i^2.$$
The first sum is $n(n+1)/2$. The second is $n(n+1)(2n+1)/6$. Altogether then, this gives
$$ S_2 = \frac{n^2(n+1)^2}{8} - \frac{n(n+1)(2n+1)}{12},$$
which can be simplified to suit. (In particular, for example, $S_2=n^4/8 + O(n^3)$).