Labs / Mathematics

Euclid's Algorithm

Two numbers set the sides of a rectangle. The algorithm keeps carving off the biggest square it can, then repeats on whatever strip is left over. Tap the canvas or hit auto-run — the side of the very last square is the greatest common divisor of your two numbers.

rect 8 × 12squares 0GCD

What to try