IMO 1985 LL CAN13

Find the average of the quantity

IMO 1985 LL CAN13

Origin: CAN

Problem

Find the average of the quantity (a1 −a2)2 + (a2 −a3)2 + \cdot \cdot \cdot + (an−1 −an)2 taken over all permutations (a1, a2, . . . , an) of (1, 2, . . . , n).