LCM Calculator (Two Numbers)
Calculate the least common multiple (LCM) of two integers. See the steps using the relation LCM = |a·b| / GCD. Handy for fractions and school problems.
MMC(a,b)
—
LCM of two numbers: formula and worked example
For two positive integers, the least common multiple is lcm(a, b) = (a · b) / gcd(a, b). The Euclidean algorithm finds the GCD in O(log min(a, b)), and the LCM falls out right after, so the whole thing stays logarithmic.
You can also work it from the prime factorisation: take each prime that shows up in either number and keep its highest exponent. Say 12 = 2² · 3 and 18 = 2 · 3². That gives lcm(12, 18) = 2² · 3² = 36.
Applications
- Adding fractions that have different denominators, where the common denominator is the LCM.
- Synchronising cyclic events such as traffic lights, periodic schedules and signal rotations.
- Working out the period at which two periodic functions line up again.
- LCM across a whole set, which you just chain pairwise, since
lcm(a, b, c) = lcm(lcm(a, b), c).
FAQ
Why divide by the GCD? The product a · b ends up counting every shared prime factor twice. Dividing by gcd(a, b) cancels that duplication out.
What if the numbers are coprime? With gcd(a, b) = 1 there's nothing to cancel, so the LCM is just the product a · b.
And if one of them is zero? The convention is lcm(0, n) = 0, because zero counts as a multiple of every integer.
Related Tools
Perfect Number Checker
Check if n is a perfect number; list its divisors.
GCD of Multiple Numbers Calculator
Calculate the GCD (greatest common divisor) of a list of integers all at once. Enter the values separated by commas and see the result instantly.
Rainbow Option on the Maximum (Stulz)
Computes the price of a call on the maximum of two assets with the Stulz (1982) formula: the option pays based on the better performer of two correlated assets, minus the strike. It's a bet on the winner of a race between two assets, and its price depends heavily on the correlation between them — the less correlated, the more valuable, because there's a greater chance at least one takes off. It uses the bivariate normal. Enter the two prices, the strike, the two volatilities, the correlation, the rate and the term.
LCM Calculator
Calculate the Least Common Multiple (LCM) of two or more numbers. Instant result in the browser.
Narcissistic / Armstrong Numbers Checker
Check whether a number is narcissistic/Armstrong (153 = 1³+5³+3³). Show the digit-power decomposition and list all narcissistic numbers in a range. Displays all 36 known base-10 narcissistic numbers from 0 to 4,679,307,774.
Rainbow Option on the Minimum (Stulz)
Computes the price of a call on the minimum of two assets with the Stulz (1982) formula: the option pays based on the worse performer of two assets, minus the strike. It's the more conservative option of the rainbow pair, valuable when you want both assets to perform. An elegant identity holds: the sum of the call on the maximum and the call on the minimum equals the sum of two plain calls. It uses the bivariate normal. Enter the two prices, the strike, the two volatilities, the correlation, the rate and the term.
The results provided by this tool are for general informational and educational purposes only and do not constitute professional, financial, medical, legal, tax or accounting advice. Always confirm important decisions with a qualified professional and official sources.