The Euclidean algorithm is usually presented as a tiny loop. Keep replacing a pair of positive integers by the smaller number and the remainder, and eventually the remainder is zero. That description is correct, but it hides the reason the algorithm works.

The invariant§

Suppose 𝑎=𝑏𝑞+𝑟. A number divides both 𝑎 and 𝑏 exactly when it divides both 𝑏 and 𝑟. So the set of common divisors does not change when we replace (𝑎,𝑏) by (𝑏,𝑟).

This is the whole proof. The pair gets smaller while its greatest common divisor stays fixed. Since non-negative integers cannot decrease forever, the process must stop.

A concrete calculation§

For 252 and 105, the remainders are 42, 21, and then 0. Reading the last non-zero remainder gives

gcd(252,105)=21Nothing is guessed; every step preserves precisely the information we care about.

Why I like it§

The algorithm is a lovely first example of a recurring mathematical trick: identify an invariant, make progress according to some measure, and let well-ordering finish the argument. The computation is short because the proof has already done the hard work.