Problem

Source: Romanian Junior BkMO TST 2004, problem 8

Tags: number theory proposed, number theory



Find all positive integers $n$ for which there exist distinct positive integers $a_1,a_2,\ldots,a_n$ such that \[ \frac 1{a_1} + \frac 2{a_2} + \cdots + \frac n { a_n} = \frac { a_1 + a_2 + \cdots + a_n } n. \]