Learn/Number Theory/Congruences
Number Theory • Topic 9

Congruences

Congruences are equations involving modular arithmetic. Solving linear congruences is similar to solving linear equations , but with a twist regarding existence and uniqueness.

Linear Congruence

A linear congruence is of the form:

Existence of Solutions

The congruence has solutions if and only if:

Number of Solutions

If , there are exactly distinct solutions modulo .
  • If , there is exactly one unique solution modulo .

Solving Strategy

  1. Check GCD: Calculate . If , no solution.
  2. Simplify: If , divide the entire congruence (including modulus) by :
Now the coefficient and new modulus are coprime.
  1. Multiply by Inverse: Multiply both sides by the modular inverse of the coefficient (see Topic 14).
Example
Solve .

Proof. 1. .

  1. Does ? Yes. There are 3 solutions modulo 21.
  2. Divide by 3: .
  3. Multiply by inverse of 2 mod 7 (which is 4, since ):
.
  1. Lift back to mod 21:
.

Practice Problems

Exercise (Problem 1)
Solve .
Exercise (Problem 2)
Find all integers such that .
Exercise (Problem 3)
Prove that has no integer solutions.