# What is the fallacy in the proof (given below) that $(n-2)! \equiv 1$ when $n$ is a prime number?

By Wilson's theorem we know that if $n$ is a prime number then $(n-1)! \equiv n-1 \pmod n$

So, upon division by $n-1$ on both the sides we have $(n-2)! \equiv 1 \pmod n$

Edit 1: The teacher deducted marks in this proof and said that I've to consider the case for mod 2 separately. Also, her claim is verified by proof given here .

• Why do you think there is a fallacy? Since $n-1$ is relative prime to $n$, you can divide like this. – Thomas Andrews Oct 18 '16 at 17:28
• en.wikipedia.org/wiki/Wilson%27s_theorem#Proofs that's not a fallacy; see the wikipedia article, in particular, "Proof Using the Sylow Theorems" – Giuseppe Oct 18 '16 at 17:29
• Perhaps it clarifies things for you if you write $(n-1)!\equiv -1\pmod n$ and remark that $n-1\equiv -1\pmod n$. – lulu Oct 18 '16 at 17:29
• The teacher deducated marks in this proof and said that I've to consider the case for mod 2 separately. Also, her claim is verified by proof given at brilliant.org/wiki/wilsons-theorem/…" – ankit Oct 18 '16 at 17:32
• Unless the teacher has issues with $0!$, there is no real reason to treat $2$ differently. – Daniel Fischer Oct 18 '16 at 17:43