For motivation, let's do some small ones by hand. For $n=1$, the set can be $\\{1\\}$ with sum $1$. For $n=2$, we can put $1$ in, but then we can't have $2$, which would give mean $\frac 32$ for the whole set. But $\\{1,3\\}$ with sum $4$ works. It should be clear that if $n \ge 2$ all the numbers have to have the same parity. For $n=3$, then, we can't use $4$, but $\\{1,3,5\\}$ with sum $9$ works. But if $n\ge 4$, we can't have all of $1,3,5$, as whatever the fourth element $k$ is, either $\\{1,3,k\\}$ or $\\{1,5,k\\}$ will not have an integral mean. The best we can do is $\\{1,7,13,19\\}$ with sum $40$
This indicates that all the numbers in the set must be equivalent $\pmod {\operatorname{lcm}(1,2,3,\dots n-1)}$ Let $p=\operatorname{lcm}(1,2,3,\dots n-1)$, then our set is $\\{1,1+p,1+2p,\dots 1+(n-1)p\\}$ with sum $\frac 12np(n-1)+n$