Theorem 7 If , then the necessary and sufficient condition for the congruence equation (22) to have a solution is
and when there is a solution, the number of solutions is .
Theorem 7 If , then the necessary and sufficient condition for the congruence equation (22) to have a solution is
and when there is a solution, the number of solutions is .
Necessity: If is a solution of (22), then from we know . This, together with Fermat's Little Theorem, leads to
Sufficiency: If equation (23) holds, then we have
where is an integer. From this, we know there must be an integer-coefficient polynomial such that
From this and Theorem 5, it follows that (22) has a solution and the number of solutions is (in fact, from the first equation of (24) and Theorem 5, the necessity is also derived).
In the example given above for modulo 11, are cases of Theorem 7, and the actual calculations match the conclusions. For the case , Theorem 7 is Theorem 2 in .