While the GCD finds the largest number that divides two given integers. The LCM works in the opposite direction — it finds the smallest number that both integers divide into. Where the GCD looks downward into shared factor structure, the LCM looks upward to the first point where two multiplication sequences meet.
What is LCM?
The least common multiple of two positive integers a and b, written lcm(a,b), is the smallest positive integer divisible by both.
The multiples of 4 are 4,8,12,16,20,24,… The multiples of 6 are 6,12,18,24,30,… The numbers appearing in both lists — the common multiples — are 12,24,36,… The smallest is 12, so lcm(4,6)=12.
The LCM always exists and is always at least as large as the larger input: lcm(a,b)≥max(a,b). The result must be a multiple of both numbers, so it cannot be smaller than either one.
At the other extreme, lcm(a,b)≤a⋅b. The product a⋅b is always a common multiple — the LCM may equal it or may be smaller, but never exceeds it.
Basic Properties
Several properties mirror those of the GCD, with directions reversed.
lcm(a,a)=a. The smallest multiple of a that is also a multiple of a is just a itself.
lcm(a,1)=a. Every positive integer is a multiple of 1, so a already qualifies.
lcm(a,b)=lcm(b,a). Order is irrelevant — the common multiples of a and b are the same as those of b and a.
lcm(a,b)≤a⋅b, with equality when a and b are coprime. The product provides an upper bound; shared factors bring the LCM below it.
Both a and b divide lcm(a,b) by definition. And the LCM divides every other common multiple — it is the smallest, and all others are its multiples.
Method 1: Listing Multiples
The most direct approach lists multiples of each number and identifies the first overlap.
For lcm(6,8):
Multiples of 6: 6,12,18,24,30,36,…
Multiples of 8: 8,16,24,32,40,…
The first number appearing in both lists is 24, so lcm(6,8)=24.
The method is intuitive and works well for small inputs. It becomes tedious when the LCM is much larger than the inputs — for lcm(7,13)=91, listing multiples of 7 up to 91 requires thirteen entries. The methods that follow avoid this exhaustive search.
Method 2: Prime Factorization
The prime factorization approach mirrors the GCD method, but takes the maximum exponent for each prime instead of the minimum.
For lcm(12,18):
12=22⋅31
18=21⋅32
Every prime appearing in either factorization must appear in the LCM — otherwise the LCM would not be divisible by both. Take the larger exponent for each: max(2,1)=2 for the prime 2, and max(1,2)=2 for the prime 3.
lcm(12,18)=22⋅32=4⋅9=36
The contrast with the GCD is symmetric. The GCD takes the minimum exponent — the overlap. The LCM takes the maximum — the full coverage needed to accommodate both numbers.
Method 3: Using GCD
When the GCD is known or easy to compute — particularly through the Euclidean algorithm — the LCM follows from a single formula:
lcm(a,b)=gcd(a,b)a⋅b
For lcm(12,18): gcd(12,18)=6, so lcm=612⋅18=6216=36.
For lcm(35,15): gcd(35,15)=5, so lcm=535⋅15=5525=105.
This is often the fastest route. The Euclidean algorithm finds the GCD efficiently even for large numbers, and a single division then delivers the LCM. No factorization or multiple-listing is needed.
A practical note: to avoid integer overflow in computation, divide before multiplying — compute gcd(a,b)a⋅b rather than gcd(a,b)a⋅b.
The identity holds because the GCD and LCM partition the prime structure of a⋅b without overlap or omission.
Consider a prime p appearing with exponent α in a and β in b. Its exponent in a⋅b is α+β. Its exponent in the GCD is min(α,β), and in the LCM is max(α,β). Since min(α,β)+max(α,β)=α+β, the exponents in gcd⋅lcm match those in a⋅b.
This holds for every prime simultaneously, so the products are equal.
The relationship is useful in both directions. Knowing the GCD gives the LCM, and knowing the LCM gives the GCD — each determines the other when a and b are fixed.
When a and b Are Coprime
If gcd(a,b)=1, the GCD–LCM formula simplifies to:
lcm(a,b)=a⋅b
With no shared prime factors, nothing overlaps. Every prime in a is absent from b, and every prime in b is absent from a. The LCM must include all of them at full strength, which is exactly what the product provides.
lcm(7,9)=63. The numbers share no common factor (gcd=1), so the LCM equals their product.
lcm(8,15)=120. Again coprime, so 8×15=120.
This also works in reverse: if lcm(a,b)=a⋅b, then a and b must be coprime. Any shared factor would pull the LCM below the product.
When One Divides the Other
If a∣b, then lcm(a,b)=b.
The larger number is already a multiple of the smaller. No number bigger than b is needed — b itself is divisible by both a and b.
lcm(4,12)=12, because 4∣12.
lcm(5,30)=30, because 5∣30.
lcm(a,a)=a, because every number divides itself.
This is the minimal case — the LCM equals the larger input. At the other extreme (coprime numbers), the LCM equals the full product. Every other case falls between these bounds: max(a,b)≤lcm(a,b)≤a⋅b.
LCM of More Than Two Numbers
Like the GCD, the LCM extends to more than two numbers by applying it pairwise:
lcm(a,b,c)=lcm(lcm(a,b),c)
For lcm(4,6,9):
lcm(4,6)=12.
lcm(12,9): factoring gives 12=22⋅3 and 9=32. Maximum exponents: 22⋅32=36.
So lcm(4,6,9)=36.
Alternatively, factor all three numbers at once and take the maximum exponent for each prime across all factorizations. Here 4=22, 6=2⋅3, 9=32. The primes present are 2 and 3, with maximums 22 and 32. The result is 36 — the same answer by a more direct route.
The order of pairing does not matter. The LCM is associative and commutative.
Applications of LCM
Adding fractions with different denominators requires a common denominator, and the LCM of the denominators is the smallest one that works. To add 41+61: lcm(4,6)=12, so 41=123 and 61=122, giving 125.
Scheduling problems are natural LCM applications. If Bus A arrives every 12 minutes and Bus B every 18 minutes, and both just arrived simultaneously, they next coincide in lcm(12,18)=36 minutes.
Cycle synchronization follows the same pattern. Two gears with 12 and 18 teeth respectively realign after 36 teeth have passed the contact point. Two blinking lights with periods of 4 and 6 seconds flash together every 12 seconds.
In each case, the question is the same: when does the first simultaneous recurrence occur? The answer is always the LCM of the individual periods.
Worked Examples
Find lcm(8,14) by listing multiples. Multiples of 8: 8,16,24,32,40,48,56. Multiples of 14: 14,28,42,56. First common multiple: 56. So lcm(8,14)=56.
Find lcm(24,90) by prime factorization. 24=23⋅3 and 90=2⋅32⋅5. Maximum exponents: 23⋅32⋅5=8⋅9⋅5=360.
Find lcm(35,15) using the GCD. gcd(35,15)=5. So lcm=535⋅15=105.
Find the common denominator for 125+187. lcm(12,18)=36. Convert: 125=3615 and 187=3614. Sum: 3629.
Verify: gcd(8,14)⋅lcm(8,14)=2⋅56=112=8⋅14. The identity holds.
Find lcm(6,10,15). lcm(6,10)=30. lcm(30,15)=30 (since 15∣30). So lcm(6,10,15)=30.