5.93 $n$ primary school students sit around a circle. A teacher walks along the circle in a counterclockwise direction and gives out candies to the students. Starting from a certain student, the teacher skips 1 student and gives a candy to the next student; then skips 2 students and gives a candy to the next student; then skips 3 students and gives a candy to the next student; $\cdots$, each time skipping 1 more student than the previous time. For what condition on $n$ will every student eventually receive a candy? Explain your reasoning.
[Solution] Number the $n$ primary school students from 1 to $n$. Thus, the problem becomes: For what value of $n$ does the set $\left\{\left.\frac{1}{2} k(k+1)(\bmod n) \right\rvert\, k \in N\right\}$ contain the set $\{0,1, \cdots, n-1\}$, i.e., a complete residue system modulo $n$.
(1) Suppose there is an odd prime $p$ such that $p \mid n$. Let $a_{k}=\frac{1}{2} k(k+1)$. Then we have
$$
a_{k+p}=a_{k}+\frac{1}{2}(2 k+1+p) p \equiv a_{k}(\bmod p) \text {. }
$$

When $1 \leqslant i<j \leqslant p$, $a_{j}-a_{i}=\frac{1}{2}(j-i)(i+j+1)$, hence
$$
a_{p-1} \equiv a_{p} \quad(\bmod p) .
$$

From (1) and (2), we know that $\left\{a_{k}(\bmod p) \mid k \in N\right\}$ cannot contain a complete residue system modulo $p$, and thus $\left\{a_{k}(\bmod n) \mid k \in N\right\}$ cannot contain a complete residue system modulo $n$ $\{0,1, \cdots, n-1\}$.
(2) Suppose $n=2^{m}$, where $m$ is a non-negative integer. It is easy to see that $a_{k+2^{m+1}} \equiv a_{k}\left(\bmod 2^{m}\right)$. For any $i, j \in\left\{1,3,5, \cdots 2^{m+1}-1\right\}$, since $i+j+1$ is odd and $|j-i|<2^{m+1}$, we have
$$
a_{j}-a_{i}=\frac{1}{2}(j-i)(i+j+1) \neq 0 \quad\left(\bmod 2^{m}\right),
$$

i.e., $a_{j} \neq a_{i}(\bmod n)$. Therefore, $\left\{a_{1}, a_{3}, a_{5}, \cdots, a_{2^{m+1}-1}(\bmod n)\right\}=\{0, 1,2, \cdots, n-1\}$.

In summary, when and only when $n=2^{m}$ (where $m$ is a non-negative integer), all students can eventually receive candy.