GCD and LCM Calculator
Calculate the GCD and LCM of 2 to 6 numbers with full Euclidean algorithm steps.
How to calculate GCD and LCM?
The GCD (Greatest Common Divisor) is the largest integer that divides two or more numbers exactly without a remainder. The LCM (Least Common Multiple) is the smallest positive integer that is a common multiple of all the numbers. These two concepts are fundamental in arithmetic, particularly for simplifying fractions and solving synchronization problems.
The Euclidean algorithm for GCD
The Euclidean algorithm is the most efficient method to calculate GCD. For two numbers a and b, divide a by b and keep remainder r. Then replace a with b and b with r, repeating until the remainder is 0. The last non-zero remainder is the GCD. Example: GCD(48, 18) → 48 = 2×18 + 12 → 18 = 1×12 + 6 → 12 = 2×6 + 0 → GCD = 6.
Relationship between GCD and LCM
For two numbers a and b: GCD(a,b) × LCM(a,b) = a × b. Therefore LCM(a,b) = (a × b) / GCD(a,b). For more than two numbers, GCD and LCM are calculated successively in pairs using the associativity of these operations.
Frequently asked questions
Tools in the same category
Popular tools
Trending tools