Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2019/ia/paper-4/5e/a/solution

Fermat's little theorem states that for a prime and integer ,
if , equivalently . For the latter form, multiplication by permutes the nonzero residue classes modulo . Multiplying the congruences and cancelling gives . The first form also covers .
Since , the theorem gives

New to topics? Read the docs here!