# Which of these is the correct statement of Wilson's theorem?

My textbook states: If $p$ is a prime, then $(p-1) \equiv -1\pmod p$.

But the online version is $(p-1)! \equiv -1\pmod p$.

Which one is correct?

• Both are correct, but the first one is trivial rather than deserving to be named after Wilson. – Tobias Kildetoft Nov 1 '16 at 10:06
• Which book is it? – lhf Nov 1 '16 at 11:14
• My book has $(p-2)! \equiv 1 \pmod p$. – I. J. Kennedy Nov 1 '16 at 20:31
• Everything written in textbooks is also modulo possible typos. – Count Iblis Nov 1 '16 at 21:36

The second one is Wilson's theorem.

Though the first one is not absurd, since

$$p\equiv 0\pmod p$$

you always have

$$p-1\equiv -1\pmod p$$

whether $p$ is prime or not.

• The first one isn't absurd, but calling it "Somebody's Theorem" is. – David Richerby Nov 1 '16 at 11:56
• @DavidRicherby, by the powers vested in me by the State of Insanity, I'm officially calling $(p − 1) ≡ −1 (\mod p)$ to be "Somebody's Theorem". – Ben Hocking Nov 1 '16 at 21:32
• @BenHocking That's absurd! – David Richerby Nov 1 '16 at 22:02