Number Theory • Topic 10
Euclidean Algorithm
The Euclidean Algorithm is an efficient method for computing the greatest common divisor (GCD) of two numbers. It is much faster than prime factorization.
The Algorithm
To find where :
- Divide by to get remainder : .
- Replace with .
- Repeat until the remainder is 0.
- The last non-zero remainder is the GCD.
Lemma
Example (GCD(252, 105))
Result: .
Geometric Interpretation
The algorithm is equivalent to tiling a rectangle of size with the largest possible squares.- Fill with squares.
- Remaining strip is .
- Fill with squares...
- The side length of the smallest square is the GCD.
Complexity
Lamé's Theorem states that the number of steps is at most 5 times the number of digits in the smaller number (related to Fibonacci numbers).Practice Problems
Exercise (Problem 1)
Use the Euclidean Algorithm to find .
Exercise (Problem 2)
Find .
Exercise (Problem 3)
If is the -th Fibonacci number, prove that the Euclidean algorithm takes exactly steps to compute .