\documentclass[a4paper,12pt]{article}

\begin{document}

\parindent=0pt

QUESTION

Prove $n\geq 5$ is a prime if and only if $6(n-4)!\equiv1$ mod
$n$.



ANSWER

By Wilson's theorem (th.4.5), $n$ is prime if and only if
$(n-1)!\equiv-1$ mod $n$. Now $n-1\equiv-1$ mod $n,\ n-2\equiv-2$
mod $n$ and $n-3\equiv-3$ mod $n$. Hence
$(n-1)!\equiv(n-4)!(-3)(-2)(-1)\equiv-6(n-4)!$ mod $n$. Thus $n$
is prime if and only if $-6(n-4)!\equiv-1$ mod $n$, which holds if
and only if $6(n-4)!\equiv1$ mod $n$.




\end{document}
