Worked solution: solve 3x ≡ 4 mod 7

Step-by-step working for this modular arithmetic problem, produced and checked by the solver.

Modular arithmetic Answer checked
Answer
x≡6(mod7)x \equiv 6 \pmod{7}
  1. The congruence
  2. gcd test
    The gcd is 1, so there is exactly one solution mod 7.
  3. Check: substitute each solution

Change the numbers and solve your own

The method in brief

  1. a mod n: divide and keep the remainder. Negative numbers still give a result from 0 to n - 1.
  2. For big powers, square repeatedly and reduce mod n at every step.
  3. The inverse of a mod n exists only when gcd(a, n) = 1. Find it with the extended Euclidean algorithm.
  4. Solve ax ≡ b (mod n): there are solutions only if gcd(a, n) divides b.

Full guide: Mod, powers mod n, inverses and congruences.

More Further maths examples on this topic