Number Theory · The Product Identity
The greatest common factor keeps shared prime factors; the least common multiple keeps enough factors to cover both numbers. Together, they account for every prime factor in the original product exactly once.
For positive integers a and b, GCF(a,b) × LCM(a,b) = a × b. For each prime, GCF takes the smaller exponent and LCM takes the larger; those two exponents add to the exponents in a × b. With 12 and 18, GCF = 6 and LCM = 36, so 6 × 36 = 12 × 18 = 216. OpenStax explains LCM through prime factors.
What Does Each Operation Select?
The GCF is the largest positive integer dividing both inputs. The LCM is the smallest positive integer divisible by both nonzero positive inputs. Factor each number into primes, then compare the exponent of each prime. A common factor can use only the smaller exponent, because it must fit into both numbers. A common multiple needs the larger exponent, because it must contain enough copies to be divisible by either number. This difference is the key to the identity.
Why Do the Two Prime Exponents Add Correctly?
Fix any prime p. Suppose p appears a times in the first number and b times in the second. In the GCF it appears min(a,b) times; in the LCM it appears max(a,b) times. The identity min(a,b) + max(a,b) = a + b means multiplying GCF and LCM yields the same power of p as multiplying the original pair. This holds separately for every prime, including a prime absent from one input, where its exponent is zero. Unique prime factorization then makes the two products equal.
How Does the Identity Work for 12 and 18?
Write 12 = 2² × 3 and 18 = 2 × 3². Their GCF uses one 2 and one 3, giving 6. Their LCM uses two 2s and two 3s, giving 36. Multiplying yields 6 × 36 = 216, the same as 12 × 18. Once you know either GCF or LCM for two nonzero numbers, you can find the other by dividing their product by the known result. The GCD and LCM Calculator also shows the Euclidean steps used to get the GCF.
Does the Formula Work with Zero, Negative Inputs, or Three Numbers?
For integers, use the absolute product: GCD(a,b) × LCM(a,b) = |a×b|, with GCD nonnegative. When one input is zero and the other is nonzero, the usual conventions give GCD(0,b) = |b| and LCM(0,b) = 0; both sides are zero. At (0,0), conventions differ; some definitions assign GCD(0,0) = 0, while others leave it undefined. The rearranged division formula must not be used with a zero divisor. The simple identity is specifically for a pair: for 6, 10, and 15, the GCF is 1 and LCM is 30, but their product is 900, not 30.
When Should You Find the GCF or the LCM?
Find a GCF when you need the largest equal grouping or want to reduce a fraction by removing shared factors. Find an LCM when you need the first shared multiple or a common denominator. For 12 and 18, the GCF 6 can divide both values into equal-sized groups, while the LCM 36 is the smallest positive number in both multiples lists. The product identity is a useful check after calculating either result; it is not a reason to use the wrong result for the task. Prime Factorization Calculator helps inspect the factors themselves.
Test Another Pair
Compute both results for two integers, then multiply GCF and LCM to check against the absolute product of the inputs.
Open the GCD and LCM CalculatorBrowse Number Tools