Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2001/ia/paper-4/7e/b/solution

Let be the multiplicative order of modulo . Use Euclidean division to write , . Since ,
If , minimality of forces , so divides . Conversely, immediately gives . For negative integers , powers are interpreted using the multiplicative inverse and the same argument applies.
Apply the result to , using Fermat's little theorem. Then , equivalently

New to topics? Read the docs here!