How can I show that $(n-1)!$ is congruent to $-1 \pmod{n}$ if and only if $n$ is prime?
Thanks.
|
How can I show that $(n-1)!$ is congruent to $-1 \pmod{n}$ if and only if $n$ is prime? Thanks. |
||||
|
|
|
$$n\text{ is prime if }(n-1)! \equiv -1 \pmod n$$ This direction is easy. If $n$ is composite, then there exists $k|n$ and $k\lt n$. So $k|(n-1)!$ and $k \equiv 1 \pmod n$. This means $k$ needs to divide $1$. So $n$ must be prime (or $1$, but we can eliminate this by substitution). $$(n-1)! \equiv -1\text{ if }n\text{ is prime}$$ Wikipedia contains two proofs of this result known as Wilson's theorem. The first proof only uses basic abstract algebra and so should be understandable with a good knowledge of modular arithmetic. Just in case, I prove below that each element They use the fact that integers |
|||||
|
|
HINT $\rm\ (p-1)!\ mod\ p\:$ is the product of all elts of $\rm\: {\mathbb F}_p^*$. The map $\rm n \mapsto n^{-1}$ is a permutation of $\rm\:{\mathbb F}_p^*\:$ of order 2 so it decomposes into cycles of length 1 or 2, which partition the product. The 2-cycles $\rm (n, n^{-1})$ have product 1 so they can be deleted from the product, leaving only the product of 1-cycles $\rm (n)$. They satisfy $\rm\: n^{-1} = n \Rightarrow n^2 = 1 \Rightarrow n = \pm 1\:$ via $\rm{\mathbb F}_p$ a field. So the product reduces to $\:-1*1 = -1$. This generalizes: if a finite abelian group has a unique elt of order 2 then it is equal to the product of all the elts; otherwise the product is 1, e.g. see this thread for hints. Notice how we've exploited the existence of a symmetry - here an involution that induces a natural pairing of elts. Frequently involution and reflection symmetries lie at the heart of elegant proofs, e.g. see the elegant proof by Liouville, Heath-Brown and Zagier, that every prime $\equiv 1 \pmod 4$ is a sum of 2 squares, or the little-known beautiful reflective generation of the ternary tree of primitive Pythagorean triples due to Aubry. |
||||
|
|
|
[NOTE: it seems that there is some difference between preview and actual output, so instead if using (mod p) I stick with (p)] to show that $(p-1)! \equiv -1 (p)$ without explicitly use group theory, maybe the simplest path is: (the following assumes $p$ is odd, but if $p=2$ then the result is immediate)
|
||||
|
Here are a couple possible proofs of Wilson's theorem for $p>2$ ($p=2$ is easily checked):
|
|||
|
|