(Walther Janous). For each natural number $n \geq 3$, determine the number $a_{n}$ of three-element subsets of $\{1,2, \ldots, n\}$ in which one element is the arithmetic mean of the other two elements.
(Walther Janous). It is clear: If the three elements are ordered by size, the two differences of adjacent elements must be equal. Therefore, a classification according to the size of the differences is a natural counting strategy.

The difference 1 yields the sets $\{1,2,3\},\{2,3,4\}, \ldots,\{n-2, n-1, n\}$, which are $n-2$ sets. With a difference of 2, one obtains $n-4$ sets in a similar manner, with a difference of 3, one gets $n-6$ sets, and so on.

Now we distinguish between the two cases, whether $n$ is even or odd.

- $n$ is even, so $n=2 k$. The largest possible difference is then $k-1$ with the two possible sets $\{1, k, 2 k-1\}$ and $\{2, k+1,2 k\}$. Therefore, the total number of the desired sets is $a_{2 k}=2+4+\ldots+(2 k-2)=k(k-1)$.
- $n$ is odd, so $n=2 k+1$. Then the largest possible difference is $k$ with the corresponding set $\{1, k+1,2 k+1\}$. Therefore, the total number of the desired sets is $a_{2 k+1}=1+3+\ldots+(2 k-1)=k^{2}$.

In summary, we have obtained that $a_{n}=\left\lfloor\frac{n}{2}\right\rfloor \cdot\left\lfloor\frac{n-1}{2}\right\rfloor$.