According to Wilson's theorem, when $p$ is prime
$$(p-1)! \equiv p-1 \mod p$$
What's the remainder in cases of
$$(p-2)! \mod p$$
or
$$(p-3)! \mod p$$
Can these be solved using Wilson's theorem also?
According to Wilson's theorem, when $p$ is prime
$$(p-1)! \equiv p-1 \mod p$$
What's the remainder in cases of
$$(p-2)! \mod p$$
or
$$(p-3)! \mod p$$
Can these be solved using Wilson's theorem also?
From Wilson theorem we have,
$(p-1)!=-1$ for $p$ prime. Now suppose $(p-2)!=x$, then $(p-1)!=(p-1)(p-2)!=(p-1) x=-1 \pmod p$.This implies $x=1\pmod p$.