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?
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?
Copyright © 2021 JogjaFile Inc.
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.