Math Fundamentals18 sections · 814 units
Open in Course

Section Recap

What we learned

You learned what GCD and LCM mean and how to compute them efficiently. The Euclidean algorithm finds GCD in O(log min(a, b)) time by repeatedly replacing (a, b) with (b, a mod b).

You saw the formula lcm(a, b) = (a × b) / gcd(a, b) and how to use inclusion-exclusion to count numbers divisible by multiple values. You walked through three problems using GCD and LCM with binary search.

You now recognize when a problem needs GCD (common factors, simplification) or LCM (synchronization, cycles). Next section: modular arithmetic and how to compute with remainders.