Problem

Source: Iranian TST 2015 second exam p5

Tags: number theory, combinatorics



We call a permutation $(a_1, a_2,\cdots , a_n)$ of the set $\{ 1,2,\cdots, n\}$ "good" if for any three natural numbers $i <j <k$, $n\nmid a_i+a_k-2a_j$ find all natural numbers $n\ge 3$ such that there exist a "good" permutation of a set $\{1,2,\cdots, n\}$.