# How to introduce Wilson's Theorem?

What is the most motivating way to introduce Wilson’s Theorem?

Why is Wilson’s theorem useful? With Fermat’s little Theorem we can say that working with residue 1 modulo prime p makes life easier but apart from working with a particular (p-1) factorial of a prime what other reasons are there for Wilson’s theorem to be useful?

Are there any good resources on this topic?

Wilson's Theorem is very powerful for proving things related to quadratic residues, and I think also in general a good theoretical tool. Motivating it by just saying "hey let's multiply everything together" seems very reasonable and even playful.

Why is this theoretical? It is basically saying that if you multiply all units together you get a specified result (see the generalization due to Gauss; there are others, too). But I don't necessarily feel the need to motivate it further than that there are beautiful things that we can say about congruences.

Edit: as another example of the theoretical power, you can use it to prove this amazing (see Hardy and Wright Appendix) formula for the prime counting function: $$\pi(n) = -1 + \sum_{j=3}^n \left((j-2)!-j\left\lfloor \frac{(j-2)!}{j}\right\rfloor\right)$$

My opinion: powerful and effective problems will increase interest and motivation.

For example, We can prove Wilson's Theorem with using Fermat's little theorem. Therefore (If preferred) we can take Wilson's theorem an appication of Fermat's. More specifically,

When $p=2$ easily $(2-1)!\equiv -1\pmod{2}$. Let $p>2$ be a odd prime. If we solve

$$x^{p-1} - 1 \equiv 0 \pmod{p} \tag{1}$$

by Fermat's theorem $x=1,2,\dots , p-1$ satisfy $(1)$. Each root is a factor of $x^{p-1} - 1$ polynomial and $$x^{p-1} - 1 \equiv (x-1)(x-2)\cdots (x-(p-1))\pmod{p} \tag{2}$$

If we put $x=0$ in $(2)$ then $1\cdot 2 \cdots (p-1) \equiv -1 \pmod{p}$

Moreover, if we find direct applications/examples of Wilson's Theorem, (I hope that) they may increase the motivating. I can give two Wilson's Theorem applications:

1) $\dfrac{10!}{13}+x$ is a positive integer then, what is mimimum positive real value of $x$?

2) If $16!$ divided by $323$, what is the remainder? (You may give a hint: $323= 17\cdot 19$.)