Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2024/ia/paper-4/1e/solution

The Wilson theorem states that for a prime ,
Indeed, every nonzero residue modulo has a unique multiplicative inverse. The only residues equal to their own inverses solve , hence are and . Pairing every other residue with its distinct inverse leaves
The Fermat little theorem states that for prime ,
equivalently, if , then .
Wilson's theorem at gives
so . Also , and therefore

New to topics? Read the docs here!