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?
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It only takes a minute to sign up.
Sign up to join this communityFor 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?
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.