Section 1
Wilson's Theorem
Test the odd integers 101 through 110 for primality by applying Wilson's theorem.
If $n$ is not prime, what are the possible values of $(n-1)!\bmod n$ ? For which composites is $(n-1)!\not \equiv 0 \bmod n$ ?
Calculate $x^2 \bmod 11$ for integers $x=1,2,3, \ldots, 9,10$ and show $x^2 \bmod 11=$ 1 only for $x=1$ or 10 .
For any positive integer $n>1$, show that $x^2 \bmod n=(n-x)^2 \bmod n$.
Find all solutions to $x^2 \bmod 15=1$ for $x \in\{1,2, \ldots, 14\}$.
Prove or disprove: If $x^2 \bmod p=1$ has exactly two solutions $x \in\{1,2, \ldots$, $p-1\}$, then $p$ is prime.
Let $p$ be an odd prime. Show that $2(p-3)!\bmod p=p-1$.
Prove that an integer $p>2$ is prime if and only if $(p-2)!\bmod p=1$.
Illustrate the proof of Wilson's theorem for $p=17$ by pairing the integers $2,3,4, \ldots, 15$ and using that to find $16!$ mod 17 .
Show that $9!+1 \bmod 19=0$ and $18!+1 \bmod 19=0$.