Problem

Source: KJMO 2018 p8

Tags: combinatorics, function



For every set $S$ with $n(\ge3)$ distinct integers, show that there exists a function $f:\{1,2,\dots,n\}\rightarrow S$ satisfying the following two conditions. (i) $\{ f(1),f(2),\dots,f(n)\} = S$ (ii) $2f(j)\neq f(i)+f(k)$ for all $1\le i<j<k\le n$.