7. $\mathbf{C 1}$ (COL) Let $A=\left(a_{1}, a_{2}, \ldots, a_{2001}\right)$ be a sequence of positive integers. Let $m$ be the number of 3-element subsequences $\left(a_{i}, a_{j}, a_{k}\right)$ 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$.
7. It is evident that arranging of $A$ in increasing order does not diminish $m$. Thus we can assume that $A$ is nondecreasing. Assume w.l.o.g. that $a_{1}=1$, and let $b_{i}$ be the number of elements of $A$ that are equal to $i$ $\left(1 \leq i \leq n=a_{2001}\right)$. Then we have $b_{1}+b_{2}+\cdots+b_{n}=2001$ and 
$$ m=b_{1} b_{2} b_{3}+b_{2} b_{3} b_{4}+\cdots+b_{n-2} b_{n-1} b_{n} $$
Now if $b_{i}, b_{j}(i<j)$ are two largest $b$'s, we deduce from (1) and the AMGM inequality that $m \leq b_{i} b_{j}\left(b_{1}+\cdots+b_{i-1}+b_{i+1}+\cdots+b_{j-1}+b_{j+1}+b_{n}\right) \leq$ $\left(\frac{2001}{3}\right)^{3}=667^{3} \quad\left(b_{1} b_{2} b_{3} \leq b_{1} b_{i} b_{j}\right.$, etc.). The value $667^{3}$ is attained for $b_{1}=b_{2}=b_{3}=667$ (i.e., $a_{1}=\cdots=a_{667}=1, a_{668}=\cdots=a_{1334}=2$, $a_{1335}=\cdots=a_{2001}=3$ ). Hence the maximum of $m$ is $667^{3}$.