For which primes $p$ is $(p-6)! \equiv 1 \mod p$ defined?

234 Views Asked by At

For which primes $p$ is $(p-6)! \equiv 1 \mod p$ defined?

I brute forced it by repeatedly trying lots of primes and ended up with $p=7, p=17$. Does anyone have a better method to do this?

1

There are 1 best solutions below

5
On BEST ANSWER

We rewrite our expression as: $$ (p-1)!(p-5)^{-1}(p-4)^{-1} \ldots (p-1)^{-1} \equiv 1 \mod p$$ Using Wilson's theorem we get: $$ -(p-5)^{-1}\ldots(p-1)^{-1} \equiv 1 \mod p$$
But $$ (p-5)^{-1}(p-4)^{-1} \ldots (p-1)^{-1} \equiv (-5!)^{-1} \mod p $$ Then, need find $p$ : $$ -(-5!)^{-1} \equiv 1 \mod p \Leftrightarrow 5! \equiv 1 \mod p$$
It is clear that if the simple is more than 120, then the remainder will not exactly be equal to 1, it remains to sort out the cases less, or try to come up with something else.