Solve any maths problem

Equations, derivatives, integrals, matrices, triangles, primes, statistics, or a word problem the tutor breaks into parts.

Inverse of 5 mod 12

5,\ 12

Step by step

  1. 5x \equiv 1 \pmod{12}

    We want x with a·x ≡ 1 (mod m). It exists only when gcd(a, m) = 1.

  2. 12 = 2 \times 5 + 2

    Euclid step.

  3. 5 = 2 \times 2 + 1

    Euclid step.

  4. 2 = 2 \times 1 + 0

    Euclid step.

  5. 5 \times 5 = 25 \equiv 1 \pmod{12}

    Back-substitute (extended Euclid) to express 1 as a combination of a and m; the coefficient of a is the inverse.

Reveal the answer
5^{-1} \equiv 5 \pmod{12}