
2. Find all natural numbers $n>1$ such that $n^{2}$ does not divide $(n-2)$ !.


Solution: Suppose $n=p q r$, where $p1$. Then $p \geq 2, q \geq 3$ and $r \geq 2$, not necessarily a prime. Thus we have

$$
\begin{aligned}
& n-2 \geq n-p=p q r-p \geq 5 p>p \\
& n-2 \geq n-q=q(p r-1) \geq 3 q>q \\
& n-2 \geq n-p r=p r(q-1) \geq 2 p r>p r \\
& n-2 \geq n-q r=q r(p-1) \geq q r
\end{aligned}
$$

Observe that $p, q, p r, q r$ are all distinct. Hence their product divides $(n-2)$ !. Thus $n^{2}=p^{2} q^{2} r^{2}$ divides $(n-2)$ ! in this case. We conclude that either $n=p q$ where $p, q$ are distinct primes or $n=p^{k}$ for some prime $p$.

Case 1. Suppose $n=p q$ for some primes $p, q$, where $2n-p=p(q-1) \geq 4 p \\
& n-2>n-q=q(p-1) \geq 2 q
\end{aligned}
$$

Thus $p, q, 2 p, 2 q$ are all distinct numbers in the set $\{1,2,3, \ldots, n-2\}$. We see that $n^{2}=p^{2} q^{2}$ divides $(n-2)!$. We conclude that $n=2 q$ for some prime $q \geq 3$. Note that $n-2=2 q-2<2 q$ in this case so that $n^{2}$ does not divide $(n-2)!$.

Case 2. Suppose $n=p^{k}$ for some prime $p$. We observe that $p, 2 p, 3 p, \ldots\left(p^{k-1}-1\right) p$ all lie in the set $\{1,2,3, \ldots, n-2\}$. If $p^{k-1}-1 \geq 2 k$, then there are at least $2 k$ multiples of $p$ in the set $\{1,2,3, \ldots, n-2\}$. Hence $n^{2}=p^{2 k}$ divides $(n-2)!$. Thus $p^{k-1}-1<2 k$.

If $k \geq 5$, then $p^{k-1}-1 \geq 2^{k-1}-1 \geq 2 k$, which may be proved by an easy induction. Hence $k \leq 4$. If $k=1$, we get $n=p$, a prime. If $k=2$, then $p-1<4$ so that $p=2$ or 3 ; we get $n=2^{2}=4$ or $n=3^{2}=9$. For $k=3$, we have $p^{2}-1<6$ giving $p=2$; $n=2^{3}=8$ in this case. Finally, $k=4$ gives $p^{3}-1<8$. Again $p=2$ and $n=2^{4}=16$. However $n^{2}=2^{8}$ divides 14! and hence is not a solution.

Thus $n=p, 2 p$ for some prime $p$ or $n=8,9$. It is easy to verify that these satisfy the conditions of the problem.
