If n=2k (k is a positive integer), then
2(i=1∑nai2−i=1∑naiai+1)=i=1∑n(ai−ai+1)2≤n(M−m)2,
therefore,
i=1∑nai2−i=1∑naiai+1≤2n(M−m)2=[2n](M−m)2.
If n=2k+1 (k is a positive integer), then for 2k+1 numbers arranged in a cyclic way, one can always find three consecutive increasing or decreasing terms (as ∏i=12k+1(ai−ai−1)(ai+1−ai)), so it is not possible that for every i, ai−ai−1 and ai+1−ai having opposite signs). Without loss of generality, we assume that a1,a2,a3 are monotonic, then
(a1−a2)2+(a2−a3)2≤(a1−a3)2.
Hence,
2(i=1∑nai2−i=1∑naiai+1)=i=1∑n(ai−ai+1)2≤(a1−a3)2+i=3∑n(ai−ai+1)2,
which transformed the question into the case of 2k numbers. We have
2(i=1∑nai2−i=1∑naiai+1)≤(a1−a3)2+i=3∑n(ai−ai+1)2≤2k(M−m)2,
i.e.,
(i=1∑nai2−i=1∑naiai+1)≤k(M−m)2=[2n](M−m)2.