01Euclid's algorithm
The greatest common divisor gcd(a, b) is the largest number dividing both. Trying every candidate is slow. Euclid noticed that any common divisor of a and b also divides a mod b, because a mod b = a − q·b. So
gcd(a, b) = gcd(b, a mod b), and gcd(a, 0) = a.
For 84 and 60: (84, 60) → (60, 24) → (24, 12) → (12, 0), so the answer is 12 after three divisions. In code it is one line: while (b) { t = a % b; a = b; b = t; }.
Once you have gcd, the least common multiple follows: lcm(a, b) = a / gcd(a, b) * b. Divide first, so the intermediate value does not overflow.