Linear congruence Created 2026-09-29 Updated 2026-10-14
A linear congruence asks for the integers satisfying , where are integers and . Let be their greatest common divisor. There are solutions exactly when divides . When solutions exist, there are exactly solution classes modulo , obtained from one solution by
The divisibility condition follows immediately from : every common divisor of must divide . Conversely, Bézout's identity constructs a solution when . Differences between any two solutions obey , equivalently , since and are coprime. This explains both the spacing and the number of solution classes.
For a complete example, solve . Here divides nine. Dividing the corresponding divisibility statement by three changes the integer modulus too:
Because , multiplying by the modular inverse three gives . Lifting this class back to modulus fifteen yields . Direct substitution gives , and , each with remainder nine after division with remainder by fifteen. By contrast, has no solutions, because three does not divide ten.
Figure 1.
Multiplication by six modulo fifteen hits residue nine three times and never hits residue ten
. Details.
This is why ordinary-looking division cannot be performed blindly in modular arithmetic. Reducing the equation and its integer modulus together keeps all solutions; retaining modulus fifteen after dividing by three would lose valid classes. When , the modular inverse of exists and gives a unique class . The Euclidean algorithm computes the Bézout coefficients needed for this construction. [ref]