Integers $1,2, \ldots, n$ are written (in some order) on the circumference of a circle. What is the smallest possible sum of moduli of the differences of neighbouring numbers?
Let $a_{1}=1, a_{2}, \ldots, a_{k}=n, a_{k+1}, \ldots, a_{n}$ be the order in which the numbers $1,2, \ldots, n$ are written around the circle. Then the sum of moduli of the differences of neighbouring numbers is

$$
\begin{aligned}
& \left|1-a_{2}\right|+\left|a_{2}-a_{3}\right|+\cdots+\left|a_{k}-n\right|+\left|n-a_{k+1}\right|+\cdots+\left|a_{n}-1\right| \\
& \geq\left|1-a_{2}+a_{2}-a_{3}+\cdots+a_{k}-n\right|+\left|n-a_{k+1}+\cdots+a_{n}-1\right| \\
& =|1-n|+|n-1|=2 n-2 .
\end{aligned}
$$

This minimum is achieved if the numbers are written around the circle in increasing order.