Theorem
The linear congruence
-
Has solution if and only if
divides
-
Has a unique solution if
-
Has
solutions, where
and
divides
given by the unique solution
of the congruence
Proof: The linear Diophantine equationhas solutions if and only if
divides
from which 1. follows.
For 2. supposeIf
is one solution of
the general solution is
but
so
is the only solution of
For 3. ifand
divides
then
but
so the last congruence has a unique solution
Hence the integers satisfying
are
None of these are congruent (mod n) because none differ by n and for any integer
is congruent
to one of them since if
as given by the Division Algorithm, then
so these are the solutions to
Example: Solve
so the congruence has three solutions (mod 21)
Cancel 3 to giveMultiply the congruence by a number so that the coefficient of
is 1. We multiply by 2 to give
and reduce both sides (mod 7) to give
Then
and
are the other solutions.
Example: Solve
so the congruence is unchanged.
Multiply by three to giveand reduce (mod 26) to give
This is the only solution.