141. Happy Prisoners. A certain jailer, carrying out a partial amnesty, proceeded as follows. First, he opened all the cells. Then he locked every second cell (in this prison all cells were arranged in a single row). On the third stage, he turned the key in every third cell (with each turn of the key, an open cell is locked, and a closed cell is unlocked). Continuing to act in this manner, on the $n$-th stage, he turned the key in every $n$-th cell. Having finished with this, he released all the prisoners who were in the open cells. Indicate the numbers of the cells in which these lucky ones were sitting.
141. Let the key in cell number $q$ be turned $t$ times. Then $t$ is equal to the number of divisors of $q$. Thus, if $q=p_{1}^{a_{1}} \cdot p_{2}^{a_{2}} \ldots p_{k}^{a_{k}}$, where $p_{i}$ are distinct prime numbers, then $t=$ $\left(a_{1}+1\right)\left(a_{2}+1\right) \ldots\left(a_{k}+1\right)$. Further, if at least one of the $a_{i}$ is odd, then $t$ is even and in the end, the $q$-th cell remains locked. If all $a_{i}$ are even, then $q$ is a perfect square, and $t$ is odd. Therefore, the lucky ones were in cells whose numbers were perfect squares.

$$
[\text { [P. M. E. J., 1, } 330 \text { (April 1953).] }
$$