1

I am currently working through Contemporary Abstract Algebra 10th edition by Gallian. I have come across a problem that looks like Wilson's Theorem from number theory.

The problem: If $n$ is a positive integer greater than $1$ and $(n-1)! \equiv 1 \mod n$ then $n$ is prime.

I don't have a problem with the proof but I am trying to connect this to the converse of Wilson's Theorem, since the theorem states that for any prime $p$, we have $(p-1)! \equiv -1 \mod p$. It is mainly the sign that is confusing me.

Bill Dubuque
  • 282,220
JPL2023
  • 21
  • This is Exercise 0.20 of the book I mentioned above. I wrote it exactly the way it is in the book – JPL2023 Feb 04 '24 at 02:50
  • Probably the intended statement was with -1 instead, but the statement is true either way (and the proof is basically the same). – Eric Wofsey Feb 04 '24 at 03:07
  • Yea, I just worked through the proof and yea it works exactly the same. Thanks – JPL2023 Feb 04 '24 at 03:08

2 Answers2

2

If $n$ is a composite number, that is, there exists $1<p<n$ such that $p$ divides $n$ and $p$ is prime. Hence $p\mid n$ and $p \mid (n-1)!$, so $(n-1)!$ and $n$ are not coprime. This proves the converse of Wilson's theorem, but we can do better.

If $n\not=p^2$, then $p$ and $n/p$ are two distinct numbers amongst $1, 2, \cdots, n-1$, so $n\mid (n-1)!$, $(n-1)!\equiv 0 \mod n$.

If $n=p^2$ and $p>2$, then $1<p<2p<p^2$ are two distinct numbers amongst $1, 2, \cdots, n-1=p^2-1$, hence $(n-1)!\equiv 0\mod n$.

We're left with the case $p=2, n=p^2=4$, in which case $3!\equiv 2\mod 4$.

In all,

$$(n-1)!\equiv\begin{cases} -1 \mod n & \text{ if } n \text{ is prime } \\ 2 & \text{ if } n=4 \\ 0 & \text{ otherwise }\end{cases}$$

Just a user
  • 22,048
  • Please strive not to post more (dupe) answers to dupes of FAQs. This is enforced site policy, see here. It's best for site health to delete this answer (which also minimizes community time wasted on dupe processing.) – Bill Dubuque Feb 04 '24 at 13:06
0

Suppose that this statement were true. Follow that line of reasoning.

Start with an integer $n > 1$ such that $(n-1)! \equiv 1 \pmod{n}$. By this conjecture, $n$ is prime. But then Wilson gives us that $(n-1)! \equiv -1 \pmod{n}$, so we have $1 \equiv -1 \pmod{n}$ or equivalently $2 \equiv 0 \pmod{n}$, which means that $n = 2$.

Clearly, this is too restrictive!

So, yeah, your suspicion is merited. The claim as written is false and likely a typo. In fact, Wilson's Theorem is an if and only if statement.

Sammy Black
  • 28,409