3 Wilson's theorem states that an integer \(p > 1\) is prime if and only if \(( p - 1 ) ! \equiv - 1 ( \bmod p )\).
- Use Wilson's theorem to show that \(17 ! \equiv 1 ( \bmod 19 )\).
- A prime number \(p\) is called a Wilson prime if \(( p - 1 ) ! \equiv - 1 \left( \bmod p ^ { 2 } \right)\). For example, 5 is a Wilson prime because \(( 5 - 1 ) ! \equiv 24 \equiv - 1 ( \bmod 25 )\). At the time of writing all known Wilson primes are less than 1000.
- Create a program to find all the known Wilson primes. Write out your program in full in the Printed Answer Booklet.
- Use your program to find and write down all the known Wilson primes.
- Prove that if there is an integer solution \(m\) to the equation \(( p - 1 ) ! + 1 = m ^ { 2 }\) where \(p\) is prime, then \(p\) is a Wilson prime.