Problem

Source: 2021 ISL N6

Tags: number theory, IMO Shortlist, AZE IMO TST



Determine all integers $n\geqslant 2$ with the following property: every $n$ pairwise distinct integers whose sum is not divisible by $n$ can be arranged in some order $a_1,a_2,\ldots, a_n$ so that $n$ divides $1\cdot a_1+2\cdot a_2+\cdots+n\cdot a_n.$ Arsenii Nikolaiev, Anton Trygub, Oleksii Masalitin, and Fedir Yudin