📐 Euclidean Algorithm
$\\gcd(a,b) = \\gcd(b, a \\mod b)$. Repeated application computes $\\gcd(a,b)$ in $O((\\log b)^2)$ bit operations.
Proof: If $a = bq + r$, then any common divisor of $a$ and $b$ also divides $r = a - bq$.
Conversely, any common divisor of $b$ and $r$ also divides $a = bq + r$.
Therefore $\\gcd(a,b) = \\gcd(b,r)$.
The algorithm terminates because remainders strictly decrease.
Each step halves the larger numbe...
From: Algebraic Number Theory
Learn more:
Explore all courses: 
Number Theory and Cryptography | Math Academy
Interactive course for learning Number Theory and Cryptography

Magic Internet Math
Interactive courses covering the mathematics that powers modern technology, from foundational algebra to the cryptography securing the internet.