We write the fractions $\frac{1}{2}, \frac{2}{3}, \ldots, \frac{n-1}{n}$ on the board. We are allowed to "flip" some of the fractions, flipping a fraction means replacing $\frac{a}{b}$ with $\frac{b}{a}$. Find the $n$ such that we can flip some fractions so that the product of the numbers on the board is 1.
(solved by Auguste Ramondou)

In a fraction equal to 1, the numerator is equal to the denominator. If it is possible, when all numbers in the table are decomposed into prime factors, the sum of all the exponents of each prime number is therefore even. Each number except $n$ and 1 appears twice, so $n$ must have only prime factors with even exponents. $n$ is therefore a square.

Conversely, if $n$ is a square, we return all the fractions preceding $\frac{\sqrt{n}}{\sqrt{n}+1}$:

$$
\frac{2}{1} \cdots \cdots \frac{\sqrt{n}}{\sqrt{n}-1} \cdot \frac{\sqrt{n}}{\sqrt{n}+1} \cdots \cdots \frac{n-1}{n}=\sqrt{n} \cdot \frac{\sqrt{n}}{n}=1
$$

The integers that are solutions are therefore the squares.