For which $n \ge 1$ is it possible to place the numbers $1, 2, \ldots, n$ in some order $(a)$ on a line segment, or $(b)$ on a circle so that for every $s$ from $1$ to $\frac{n(n+1)}{2}$, there is a connected subset of the segement or circle such that the sum of the numbers in that subset is $s$?