Least Common Multiple Calculator
Least Common Multiple Calculator
Euclidean

Euclidean Algorithm LCM Calculator

Find the GCD using Euclid's division algorithm steps, then compute LCM efficiently.

Euclidean Algorithm LCM Calculator Inputs

Integer a

Integer b

Calculation Result Verified Result
Answer
--
Calculation Output

Step-by-Step Explanation

Calculating initial values...

How Euclidean Algorithm LCM Calculator Works?

The Euclidean Algorithm LCM Calculator works by replacing the larger number with the remainder of a division, repeating until the remainder reaches 0.

1. Divides larger by smaller

For 48 and 18, the step 48 = 2 × 18 + 12 records remainder 12.

2. Shifts the pair

The pair becomes 18 and 12, so the old remainder becomes the new divisor.

3. Repeats until remainder 0

18 = 1 × 12 + 6, then 12 = 2 × 6 + 0 ends the chain.

4. Converts the GCD to an LCM

The last non-zero remainder 6 is the GCD, and (48 ÷ 6) × 18 = 144.

Euclidean Algorithm LCM Calculator Formula

The Euclidean Algorithm LCM Calculator applies GCD(a, b) = GCD(b, a mod b) until b reaches 0, then divides the product by that GCD.

GCD(a, b) = GCD(b, a mod b); LCM(a, b) = a × b ÷ GCD(a, b)

Formula Terms

a mod b
Remainder after dividing a by b.
Termination
The chain ends when the remainder reaches 0, which always happens in finite steps.
Step bound
The step count stays below 5 times the digit count of the smaller input.

Worked Example

  1. 1Input: 48 and 18.
  2. 248 mod 18 = 12.
  3. 318 mod 12 = 6.
  4. 412 mod 6 = 0, so GCD = 6.
  5. 5LCM = 48 × 18 ÷ 6 = 144, found in 3 remainder steps.

Euclidean Algorithm LCM Calculator Conversion Table

The table below lists the remainder chain length and result for 7 pairs.

PairRemainder chainStepsGCDLCM
48, 1812, 6, 036144
270, 19278, 36, 6, 0468640
1071, 462147, 21, 032123562
21, 138, 5, 3, 2, 1, 061273
144, 6024, 12, 0312720
100, 3628, 8, 4, 044900
89, 5534, 21, 13, 8, 5, 3, 2, 1, 0914895

Consecutive Fibonacci numbers such as 89 and 55 force the longest chain, which is the worst case for this algorithm.

What is Euclidean Algorithm LCM Calculator?

The Euclidean Algorithm LCM Calculator is a remainder-chain solver that finds the greatest common divisor by repeated division, then converts it into the least common multiple.

The method dates to Euclid, Elements Book VII, and remains the standard integer routine in modern libraries because its step count grows with digit length rather than with value.

Factorisation needs no primes here. The pair 1071 and 462 resolves in 3 remainder steps, while trial division would test divisors up to 21 first.

What are the uses of Euclidean Algorithm LCM Calculator?

The Euclidean Algorithm LCM Calculator has 5 main uses.

  • Computing with large integers

    A 9-digit pair needs roughly 15 remainder steps rather than thousands of trial divisions.

  • Teaching algorithm analysis

    Fibonacci pairs demonstrate the worst-case step count.

  • Implementing library code

    The loop converts directly into 4 lines of code with modulo arithmetic.

  • Proving coprimality

    A final GCD of 1, as for 21 and 13, confirms no shared factor.

  • Showing the full chain

    Each remainder line gives a checkable record of the computation.

Related LCM Calculators

View All →