3.5.3 Wilson’s Theorem

I’ve seen a couple of questions in the latter stages of the number sense question which asks something along the lines of:

6!x(mod 7),0x6,x=?6! \cong x (\text{mod } 7), 0 \le x \le 6, x = ?

Questions like this use the result from Wilson’ Theorem which states:

For prime pp, (p1)!(p1)(mod p)(p - 1)! \cong (p - 1) (\text{mod } p)

So using the above Theorem, we know that 6!x(mod 7),0x6,x=66! \cong x (\text{mod } 7), 0 \le x \le 6, x = 6.

It is essentially for pp to be prime Wilson’s Theorem to be applicable. Usually, with factorial problems, you can lump common factors and then can check divisibility. For example:

4!x(mod 6),0x5,x=?4! \cong x (\text{mod } 6), 0 \le x \le 5, x = ?

Well we know that 4!=4321=460(mod 6)x=04! = 4 \cdot 3 \cdot 2 \cdot 1 = 4 \cdot 6 \cong 0 (\text{mod } 6) \Rightarrow x = 0.

The following are some more problems to give you some practice:

Problem Set 3.5.3

(4!)(3!)(2!)congx(textmod8)(4!)(3!)(2!) \\cong x (\\text{mod } 8), 0lexle70 \\le x \\le 7, then x=x =
(4+2)!congx(textmod7)(4 + 2)! \\cong x (\\text{mod } 7), 0lexle60 \\le x \\le 6, then x=x =
(52)!congx(textmod5)(5 - 2)! \\cong x (\\text{mod } 5), 0lexle50 \\le x \\le 5, then x=x =
frac5!cdot3!4!congk(textmod8)\\frac{5! \\cdot 3!}{4!} \\cong k (\\text{mod } 8), 0lekle70 \\le k \\le 7, then k=k =
frac5!cdot4!3!congk(textmod9)\\frac{5! \\cdot 4!}{3!} \\cong k (\\text{mod } 9), 0lekle80 \\le k \\le 8, then k=k =
5!cdot3!congk(textmod8)5! \\cdot 3! \\cong k (\\text{mod } 8), 0lekle70 \\le k \\le 7, then k=k =