A. 587. Find all positive integers n for which there exists a sequence a1<a2<...<an of positive integers with the property that the sums ai+aj with 1i<jn are distinct and among them each modulo 4 residue occurs the same number of times.
(Proposed by Ilya Bogdanov, Moscow)
Deadline expired on 10 May 2013.