Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2013/ia/paper-4/8e/i/solution

For Fermat's little theorem, first suppose . Multiplication by permutes the nonzero residue classes modulo : if , the prime cannot divide , so cancellation gives . Multiplying the representatives in this permutation,
Every factor of the factorial is nonzero modulo the prime, so the factorial has a modular inverse and can be cancelled. Thus and . If , both sides are zero modulo . Hence for every integer ,
For completeness, the cancellation used above follows from Bézout's identity: a number relatively prime to has an inverse modulo .

New to topics? Read the docs here!