Formulas
GCD — Euclidean algorithm: gcd(a, b) = gcd(b, a mod b), until b = 0
LCM = |a × b| / gcd(a, b)
For multiple numbers, apply iteratively: gcd(a, b, c) = gcd(gcd(a, b), c).
FAQ
What is GCD used for?
GCD is used to simplify fractions (divide numerator and denominator by their GCD), solve problems in number theory, and in algorithms like RSA encryption.
What is LCM used for?
LCM is used to find a common denominator for fractions, solve scheduling problems (when events with different periods coincide), and in gear-ratio calculations.