Problem to finish the question: If $n > 4$ is compound then $(n-1)!\equiv 0\pmod n$ Problem to finish the question: If $n > 4$ is compound then $(n-1)!\equiv 0\pmod n$.
If $n = a\cdot b$ there is no problem, once $a, b$ are factors of $(n-1)!$. The problem is when $ n = p^2$. I know that once $p > 4$ then  $p^2 \ge 3$. But, how can I justify that $p^2$ is a factor of $(n-1)!$?
Thanks a lot.
Cordially
 A: If $n=p^2$, $n-1=p^2-1$, so $\;p, 2p,\dots ,(p-1)p$ are distinct factors of $\;(n-1)!$, hence $p^{p-1}$  is a factor thereof. As $n=p^2>4$, $p\ge 3$, and $p-1\ge 2$.
A: Let $n = p^2$, clearly $p$ must be contained in $(n-1)! = (n-1)(n-2)\cdots 1.$
So $p|(n-1)!$ . Note that $2p < n$, why? Suppose $2p > n$, then $p > {n\over 2}$, so that $p^2 > \frac{n^2}{4}$,  but remember you have $n>4$, if $p^2>\frac{n^2}{4}$, then $p^2>n^2$, a contradiction. So $2p < n$. Therefore $2p$ is also contained in $(n-1)!$.
Thus $p^2 = n | (n-1)!$, and $(n-1)! = 0 \pmod n$.
A: More generally: define $\upsilon_p(n!)=k\iff \left(p^k\mid n!,\, p^{k+1}\nmid n!\right)$
(this is standard notation; see this paper). 
$\lfloor x\rfloor$ is the Floor Function, i.e. the largest integer smaller than or equal to $x$.
$$\upsilon_p(n!)=\lfloor\frac{n}{p}\rfloor+\lfloor\frac{n}{p^2}\rfloor+\lfloor\frac{n}{p^3}\rfloor\cdots$$
In this case:
$$\upsilon_p((p^2-1)!)=\lfloor\frac{p^2-1}{p}\rfloor+\lfloor\frac{p^2-1}{p^2}\rfloor+\lfloor\frac{p^2-1}{p^3}\rfloor\cdots$$
$$=\lfloor p-\frac{1}{p}\rfloor+\lfloor 1-\frac{1}{p^2}\rfloor+\cdots=(p-1)+0+\cdots=p-1$$
Since $p^2>4$, we get $p\ge 3$ and $p-1\ge 2$, so $$p^{p-1}\mid (p^2-1)!\implies p^2\mid (p^2-1)!$$
