Can you propose a theorem from these congruences?

Find the least positive residues of

a) $6! \ (\mod 7)$

b) $10! \ (\mod 7)$

c) $12 ! \ (\mod 13)$

d) $16! \ (\mod 17)$

e) Can you propose a theorem from above congruent?

My answer is:

$6 \equiv 6 \pmod 7$

$6.5 \equiv 2 \pmod 7$

$ 6.5.4 \equiv 1\pmod 7 $

$ 6.5.4.3 \equiv 3\pmod 7 $

$6!=6\cdot5\cdot4\cdot3\cdot2 \equiv 6\pmod 7 $

b) By the same way I got that $10! \equiv 10 \pmod{11}$

I concluded that $(p-1)!\equiv (p-1) \pmod p$. But is there an easier way for (c) and (d) ? Thanks.


Hint: Given a prime $p$, for any $a$ with $0<a<p$, there is a unique $b$ with $0<b<p$ such that $ab \equiv 1\pmod p$. Now, for $a = 1$ or $a = p-1$, the corresponding $b$ is equal to $a$, but for every other $a$, we have $b\neq a$.


Wilson's Theorem :-

A natural number $n $ is a prime $\iff (n-1)! \equiv -1\pmod n$.