# Derive an equation in n for the mean of the products of all distinct pairs of positive integers whose sum is n

Motivation

I am currently working on the following problem from Hardy's A Course of Pure Mathematics.

The arithmetic mean of the products of all distinct pairs of positive integers whose sum is n is denoted by $S_n$. Show that $\lim{\dfrac{S_n}{n^2}}=\dfrac{1}{6}$

My Question

What is a function of n that will satisfy the description of $S_n$

My Attempt

The function, $S_n$ can be separated into two parts, the numerator and the denominator.

To identify a patter than will allow these to be identified, first I had calculated some the particular values of $S_n$ for some $n$.

For $n=1$ and $n=2$ the case is trivial.

For the following $n$ we have (ignoring the denominator):

n         $S_n$

$3$         $1 \times 2$

$4$         $1 \times 3$

$5$         $1 \times 4 + 2 \times 3$

$6$         $1 \times 5 + 2 \times 4$

$7$         $1 \times 6 + 2 \times 5 + 3 \times 4$

$8$         $1 \times 7 + 2 \times 6 + 3 \times 5$

For the denominator a pattern emerges. It increases by 1 for every two n starting at 3. One option I was thinking is $\lfloor \dfrac{n-1}{2} \rfloor$, but it does not seem to lend itself well to the purposes of the equations derivation.

For the numerator, a pattern can be observed through the columns.

The first column can be simplified to $(n-1)$. If I exclude $n=2,3$ then the second column would be $2(n-2)$ and the third $3(n-3)$ and so on.

Ignoring the issue of earlier numbers not being included in some columns, a start towards the appropriate equation would be:

$(n-1) + 2(n-2) + 3(n-3) + ...$

But I am unsure on what to do with this equation such that it will hold given all $n$.

Based on Julien's hint, I had provided my attempted proof below

-

## 1 Answer

Note $$\sum_{k=1}^{n-1}k(n-k)=n\sum_{k=1}^{n-1}k-\sum_{k=1}^{n-1}k^2$$ Now use the appropriate Faulhaber's formulas. With this closed form, it will be easy to compute the limit.

Edit: here is what you get for the sum above, for every $n\geq 2$ $$n\frac{(n-1)n}{2}-\frac{(n-1)n(2n-1)}{6}=\frac{n^3-n}{6}=\frac{n(n-1)(n+1)}{6}.$$ Therefore, the arithmetic mean you want to consider is $$S_n=\frac{1}{n-1}\sum_{k=1}^{n-1}k(n-k)=\frac{n(n+1)}{6}.$$ Now the limit you were asked is $$\frac{S_n}{n^2}=\frac{n(n+1)}{6n^2}=\frac{1+\frac{1}{n}}{6}\longrightarrow \frac{1}{6}.$$

-