Given a finite sequence of integers a1,a2,...,an for n≥2. Show that there exists a subsequence ak1,ak2,...,akm, where 1≤k1≤k2≤...≤km≤n, such that the number ak12+ak22+...+akm2 is divisible by
n.
Note by Darij: Of course, the 1≤k1≤k2≤...≤km≤n should be understood as 1≤k1<k2<...<km≤n; else, we could take m=n and k1=k2=...=km, so that the number ak12+ak22+...+akm2=n2ak12 will surely be divisible by n.