Subjects number theory

Modular Inverse

Step-by-step solutions with LaTeX - clean, fast, and student-friendly.

Search Solutions

Modular Inverse


1. **Problem Statement:** We need to find the multiplicative inverse of $a=5$ modulo a prime number $p=17$. This means finding an integer $x$ such that: $$5 \times x \equiv 1 \pmod{17}$$ 2. **Formula and Important Rules:** The multiplicative inverse of $a$ modulo $p$ exists if and only if $a$ and $p$ are coprime. Since $p=17$ is prime and $a=5$ is not divisible by 17, the inverse exists. 3. **Method:** We can use the Extended Euclidean Algorithm to find $x$ such that: $$5x + 17y = 1$$ for some integer $y$. 4. **Applying the Extended Euclidean Algorithm:** - Divide 17 by 5: $$17 = 5 \times 3 + 2$$ - Divide 5 by 2: $$5 = 2 \times 2 + 1$$ - Divide 2 by 1: $$2 = 1 \times 2 + 0$$ Since the remainder is 1, the gcd is 1, confirming the inverse exists. 5. **Back substitution to express 1 as a combination of 5 and 17:** $$1 = 5 - 2 \times 2$$ From step 1: $$2 = 17 - 5 \times 3$$ Substitute: $$1 = 5 - 2 \times (17 - 5 \times 3) = 5 - 2 \times 17 + 5 \times 6 = 5 \times 7 - 17 \times 2$$ 6. **Conclusion:** This means: $$5 \times 7 \equiv 1 \pmod{17}$$ Therefore, the multiplicative inverse of $5$ modulo $17$ is **7**.