Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2008/ia/paper-4/6d/a/solution

Let . If the linear congruence holds, then for some integer , so the greatest common divisor divides . Conversely, Bézout's identity gives integers with . If , multiply this identity by to obtain . Hence
For the number of solutions, write , and . The linear congruence becomes , where are coprime integers. Multiplication by is invertible modulo by Bézout's identity, so the solutions form one residue class . Modulo , these are exactly
They are distinct: if two have the same residue class modulo , then divides , forcing ; with , this forces . Every other solution differs from by a multiple of , so these exhaust the solutions.
Finally,
Combining this with the existence criterion gives the requested equivalent modular congruence.

New to topics? Read the docs here!