Problem

Source: Iran TST 2002 (aka: iranian olympiad/3'rd round/2002)

Tags: quadratics, induction, group theory, combinatorics proposed, combinatorics



We call a permutation $ \left(a_1, a_2, ..., a_n\right)$ of $ \left(1, 2, ..., n\right)$ quadratic if there exists at least a perfect square among the numbers $ a_1$, $ a_1 + a_2$, $ ...$, $ a_1 + a_2 + ... + a_n$. Find all natural numbers $ n$ such that all permutations in $ S_n$ are quadratic. Remark. $ S_{n}$ denotes the $ n$-th symmetric group, the group of permutations on $ n$ elements.