Exercise · ZW-EUCLIDEAN-ALGORITHM-008 · ★★☆ Intermediate
For any positive integer \(n\), what is \(\gcd(n,n+1)\)?
Choose one option.
Show answer
- D. 1
Exercise · ZW-EUCLIDEAN-ALGORITHM-008 · ★★☆ Intermediate
Choose one option.
\((n+1)\bmod n=1\), so the pair becomes \((n,1)\) and then \((1,0)\): the greatest common divisor is 1.
The Euclidean algorithm computes the greatest common divisor of two integers \(a\) and \(b\) by dividing repeatedly, replacing each pair by the divisor and the remainder, until the remainder is 0.