Visual walkthrough — Euclidean algorithm — GCD computation
Step 0 — The two words we need first
Before any algorithm, two plain ideas.
Look at the picture: the coral strip is , the mint strip is , and the little lavender tile fits into both with no gap.

That tile is what we are hunting. We could hunt it by factoring — but factoring huge numbers is slow. So we look for a cheaper move. (See 2.5.03-fundamental-theorem-of-arithmetic for the factoring route.)
Step 1 — Lay the small strip against the big one
WHAT. Put the mint strip (length ) down repeatedly along the coral strip (length ) as many whole times as it fits. Call that count (the quotient). Whatever sticks out past the last full copy is the leftover (the remainder).
WHY. This is the only thing we are allowed to do with lengths and no calculator: measure one against the other. It turns the vague "big number" into a clean sentence.
PICTURE. Below, whole mint sticks fit into coral, and the coral tail past them is .

This "" is the same division algorithm from 2.5.01-divisibility-and-division-algorithm. Notice — the leftover is what remains after subtracting whole sticks.
Step 2 — The magic claim: the leftover keeps the same tiles
WHAT. Claim: every tile that fits both and also fits , and vice-versa. So and share exactly the same common divisors as and .
WHY. If this is true, the biggest shared tile is identical for both pairs: Then we can throw away the big number and work with the smaller pair — a genuinely easier problem.
PICTURE. Watch the lavender tile. It fills exactly, so it fills the whole run of sticks exactly (). The leftover is — a difference of two things the tile fills — so the tile must fill too, with no gap.

The proof in plain arithmetic: if fits then fits (a whole number of 's). Fitting and fitting means fits their difference . Nothing magic — just "a divisor of two numbers divides their difference."
Step 3 — Rename and repeat (the recursion)
WHAT. Since has the same GCD as , forget . Rename: the old stick becomes the new long strip, the old leftover becomes the new stick. Then measure again.
WHY. Each pass makes the numbers smaller but keeps the answer identical. That's the whole trick: shrink the problem without changing its solution.
PICTURE. The old leftover (coral tail) is picked up and stood on end as the new measuring stick against the old mint stick.

Step 4 — Why it must stop (termination)
WHAT. The remainders form a strictly shrinking chain of non-negative whole numbers:
WHY. Every remainder is smaller than the stick that made it (Step 1 guaranteed ). A decreasing sequence of whole numbers cannot fall forever — it must hit . When some remainder is , the stick fit exactly, and that stick is the GCD (Mistake 3 in the parent: remainder means "perfect fit," not "no answer").
PICTURE. A staircase of strips, each shorter than the last, ending at a strip that tiles the one before it perfectly (leftover ).

Step 5 — Worked case: as falling strips
WHAT. Run the picture on real numbers.
| Long | Stick | Leftover | |
|---|---|---|---|
| 48 | 18 | 12 | |
| 18 | 12 | 6 | |
| 12 | 6 | 0 |
WHY. Each row is Step 1 done once; each down-arrow is Step 3's rename. The leftover reaches at row 3, so the last non-zero stick, , is the answer.
PICTURE. Three shrinking bars: , with tiling exactly.

Step 6 — Edge cases you must never trip on
WHAT & WHY. Four corners the picture must survive.
PICTURE. Four mini-panels: the swap, the instant fit, the empty stick, and the long coprime staircase ending at a unit tile.

The one-picture summary
Everything on one canvas: the division that makes a leftover, the arrow showing the leftover inherits every tile, the rename that shrinks the pair, and the staircase falling to a perfect fit whose stick is the GCD.

Recall Feynman retelling — say it like you'd tell a friend
You've got two sticks. Lay the short one along the long one as many times as it goes; there's a little scrap left over that's shorter than the short stick. Here's the secret: any ruler that measures both original sticks perfectly also measures that scrap perfectly — because the scrap is just the long stick minus a whole number of short sticks. So I don't lose any answer by throwing the long stick away and keeping (short stick, scrap). Do it again. The scraps get smaller every single time and are never negative, so eventually a scrap fits perfectly with nothing left over. That last perfectly-fitting stick is the biggest ruler that measures both — the GCD. If I hand it two numbers backwards, the first step just flips them. If one number is , there's nothing to measure and the other number is the answer. That's the entire algorithm, and it's why it's so fast: the numbers shrink toward zero instead of us hunting for prime factors.
Recall Quick self-test
Why can we replace with ? ::: Because , so any divisor of and divides (and vice-versa) — both pairs share the same common divisors, hence the same greatest one. What guarantees the algorithm stops? ::: Remainders strictly decrease () and stay ; a shrinking chain of whole numbers must reach . What is the GCD once the loop ends? ::: The last non-zero remainder — the stick that finally divided evenly. What is ? ::: , the base case.
Connections
- 2.5.01-divisibility-and-division-algorithm — is the engine of every step here.
- 2.5.03-fundamental-theorem-of-arithmetic — the slower factoring route we deliberately avoid.
- 2.5.08-extended-euclidean-algorithm — run these steps backward to get .
- 2.5.10-bezouts-identity — that falls out of the same picture.
- 2.5.15-modular-arithmetic-basics — is exactly the leftover we used.
- 3.2.04-rsa-encryption — why "fast GCD without factoring" matters in practice.
- 1.4.09-fibonacci-sequence — the slowest inputs are Fibonacci neighbours.