MethodMath
Ask
Join
HomeTopicsAskAlerts
Profile

© 2026 MethodMath. Built for mathematical knowledge sharing.

AboutContactGuidelinesPrivacyTermsCookies
Zara Patel
Apr 26, 2026

How to solve linear congruences using the Extended Euclidean Algorithm?

I'm studying number theory and I need to solve linear congruences like:

17x≡3(mod29)17x \equiv 3 \pmod{29}17x≡3(mod29)

I know I need to find the modular inverse of 171717 modulo 292929 using the Extended Euclidean Algorithm. But I get confused with the back-substitution step.

Could someone show me how to solve this specific congruence step by step, explaining how the Extended Euclidean Algorithm works?

1 answers355 views

1 Answer

3
David Kim
Apr 26, 2026
Accepted
Here is the complete solution using the Extended Euclidean Algorithm. **Problem:** Solve $17x \equiv 3 \pmod{29}$. **Step 1: Run the Euclidean algorithm on $29$ and $17$.** \begin{align*} 29 &= 1 \cdot 17 + 12 \\ 17 &= 1 \cdot 12 + 5 \\ 12 &= 2 \cdot 5 + 2 \\ 5 &= 2 \cdot 2 + 1 \\ 2 &= 2 \cdot 1 + 0 \end{align*} The GCD is $1$, so $17$ has an inverse modulo $29$. **Step 2: Extended algorithm (back-substitution).** From the second-last line: $1 = 5 - 2 \cdot 2$ Substitute $2 = 12 - 2 \cdot 5$: $1 = 5 - 2(12 - 2 \cdot 5) = 5 \cdot 5 - 2 \cdot 12$ Substitute $5 = 17 - 12$: $1 = 5(17 - 12) - 2 \cdot 12 = 5 \cdot 17 - 7 \cdot 12$ Substitute $12 = 29 - 17$: $1 = 5 \cdot 17 - 7(29 - 17) = 12 \cdot 17 - 7 \cdot 29$ **Step 3: Extract the inverse.** $12 \cdot 17 - 7 \cdot 29 = 1$ implies $12 \cdot 17 \equiv 1 \pmod{29}$. So the inverse of $17$ modulo $29$ is $12$. **Step 4: Solve the congruence.** Multiply both sides by $12$: $$17x \equiv 3 \pmod{29} \implies x \equiv 12 \cdot 3 \equiv 36 \equiv 7 \pmod{29}$$ **Answer:** $\boxed{x \equiv 7 \pmod{29}}$. **Verification:** $17 \cdot 7 = 119 = 4 \cdot 29 + 3 \equiv 3 \pmod{29}$ ✓
Still unsure? Join to comment or ask a follow-up.
Login or Register to post your answer

Suggested questions

Why does 0 factorial equal 1 instead of 0? Simple proof

31.4k

How many squares are actually in an 8 by 8 chessboard?

22.2k

How many ways to arrange n distinct objects in a circle? (Circular permutations)

2885

Does the Banach-Steinhaus theorem hold for non-complete normed spaces?

31.1k

Do I need Calculus 3 before learning Fourier series?

3501