Problem

Source: Romania TST 2016 Day 3 P1

Tags: algebra, number theory



Given a positive integer $n$, determine all functions $f$ from the first $n$ positive integers to the positive integers, satisfying the following two conditions: (1) $\sum_{k=1}^{n}{f(k)}=2n$; and (2) $\sum_{k\in K}{f(k)}=n$ for no subset $K$ of the first $n$ positive integers.