5. For which integers $n \geq 2$ can we arrange the numbers $1,2, \ldots, n$ in a row, such that for all integers $1 \leq k \leq n$ the sum of the first $k$ numbers in the row is divisible by $k$ ?

Answer: This is only possible for $n=3$.
Solution (Valentin): If we let $k=n$ we find that

$$
n \left\lvert\, \frac{n(n+1)}{2}\right.
$$

which implies that $n$ has to be odd. For $n=3$ the arrangement 1,3,2 satisfies the condition. From now on assume that $a_{1}, a_{2}, \ldots, a_{n}$ is a valid arrangement for an odd $n \geq 5$. If we now let $k=n-1$ we find that

$$
n-1 \left\lvert\, \frac{n(n+1)}{2}-a_{n} \Longrightarrow a_{n} \equiv n \cdot \frac{n+1}{2} \equiv \frac{n+1}{2} \quad \bmod n-1\right.
$$

But $1 \leq a_{n} \leq n$ and $n \geq 5$ implies that $a_{n}=\frac{n+1}{2}$ since $\frac{n+1}{2}+n-1$ would already exceed $n$. Now we let $k=n-2$ to find

$$
n-2 \left\lvert\, \frac{n(n+1)}{2}-\frac{n+1}{2}-a_{n-1} \Longrightarrow a_{n-1} \equiv \frac{n^{2}-1}{2}=(n-1) \cdot \frac{n+1}{2} \equiv \frac{n+1}{2} \quad \bmod n-2\right.
$$

But similarly to before since $1 \leq a_{n-1} \leq n$ and $n \geq 5$ this implies that $a_{n-1}=\frac{n+1}{2}$ as well, a contradiction. We conclude that $n=3$ is the only value for which this is possible.