Problem: (Australia Math Competition) There are 42 points $P_1, P_2, \ldots, P_{42}$ placed in order on a straight line so that the distance from $P_i$ to $P_{i+1}$ is $1 / i$, where $1 \leq i \leq 41$. What is the sum of the distances between every pair of these points?
Solution: For any $i,j \in \{ 1,2,\dots,42 \}$ with $i < j$, notice that the distance between $P_{i}$ and $P_{j}$ is $\frac{1}{i}+\frac{1}{i+1} + \dots + \frac{1}{j-2} +\frac{1}{j-1}$. So, for a given $i \in \{ 1,\dots, 42 \}$, the number of times $\frac{1}{i}$ appears in the grand sum over all distances between points is exactly the number of ways we can choose $a \leq i$ and $b >i$ (so that $\frac{1}{i}$ appears in the distance between $P_{a}$ and $P_{b}$). There are $i(42-i)$ such ways to choose $a$ and $b$. Hence, the sum of distances between every pair of points is $\sum_{i = 1}^{42}i(i-1) \cdot \frac{1}{i} = \sum_{i = 1}^{42}(42-i) = 861$.