Problem

Source: IMO ShortList 2001, combinatorics problem 1

Tags: modular arithmetic, combinatorics, Extremal combinatorics, maximization, IMO Shortlist



Let $A = (a_1, a_2, \ldots, a_{2001})$ be a sequence of positive integers. Let $m$ be the number of 3-element subsequences $(a_i,a_j,a_k)$ with $1 \leq i < j < k \leq 2001$, such that $a_j = a_i + 1$ and $a_k = a_j + 1$. Considering all such sequences $A$, find the greatest value of $m$.


Attachments: