Cross-checking a greatest common divisor and least common multiple
For two positive integers, the greatest common divisor times the least common multiple equals the product of the two numbers. This guide uses that identity as a three-step arithmetic check.
What the product identity says
Take two positive integers a and b. Their greatest common divisor (GCD) is the largest integer that divides both, and their least common multiple (LCM) is the smallest positive integer that both divide. The identity gcd(a, b) × lcm(a, b) = a × b ties the two summaries to the original numbers. For 24 and 36 the GCD is 12 and the LCM is 72, and 12 × 72 = 864, which is also 24 × 36. The identity is a useful sanity check on a worksheet or a program because it uses three separate operations that should agree. It applies to two numbers at a time. It does not describe the relationship for three or more numbers, and it needs positive inputs to be stated without sign conventions.
Prime exponents explain the product identity
Write each number as a product of prime powers. For 24 = 2³ × 3 and 36 = 2² × 3², the GCD takes the smaller exponent of each prime and the LCM takes the larger. The GCD is 2² × 3 = 12 and the LCM is 2³ × 3² = 72. For every prime, the smaller exponent plus the larger exponent equals the sum of the two original exponents, so multiplying the GCD and LCM rebuilds exactly the primes of a × b. Here that is 2⁵ × 3³ = 864. This is also why the LCM formula lcm(a, b) = |a × b| ÷ gcd(a, b) works: it is the identity solved for the LCM. Knowing that connection tells you which parts of the check are independent and which are not.
Running the three tool steps
The worked cases below the article run the check in three stages. The GCD calculator, which follows the Euclidean rule gcd(a, b) = gcd(b, a mod b), returns 12 for 24 and 36. The LCM calculator returns 72. The basic calculator then multiplies 12 by 72 and returns 864. The last step compares that product with 24 × 36, which you can work out separately as 24 × 36 = 24 × 30 + 24 × 6 = 720 + 144 = 864. Keep the source numbers and the output numbers on separate lines of your worksheet. A common slip is to type the LCM into the GCD box or to multiply the two outputs by one of the inputs instead of by each other.
How independent the check really is
The LCM tool uses the formula |a × b| ÷ gcd(a, b). Because of that, a product check on its outputs will always pass if the GCD was computed correctly and the division was exact. If the GCD were wrong but still a divisor of the product, the LCM would shift by the matching factor, and the product of the two outputs would still equal 864. So this check confirms the multiplication and the division. It does not independently confirm the GCD. To check the GCD, list the divisors of each number, or compare prime factorizations, and confirm that 12 divides both 24 and 36 while no larger number does. Checking the LCM by listing multiples gives a second, separate confirmation.
A coprime pair and a shared-factor pair
Try 15 and 28. They share no prime factor, so the GCD is 1 and the LCM equals the full product 420. Then 1 × 420 = 420 = 15 × 28, and the identity still holds trivially. Coprime pairs are the case where an LCM is largest relative to the inputs. Now try 18 and 30. The GCD is 6 and the LCM is 90, and 6 × 90 = 540 = 18 × 30. With 12 and 18 the GCD is 6 and the LCM is 36, giving 216. Pairs where one number divides the other are a third pattern. For 12 and 36 the GCD is 12 and the LCM is 36, so the GCD times the LCM is 432, the same as 12 × 36. Working a few pairs of each kind builds trust in the identity.
Where the identity is used
The identity shows up whenever two cycles or two denominators must be aligned. Adding the fractions 5/24 and 7/36 needs a common denominator, and the LCM 72 is the smallest. Two meshed gears with 24 and 36 teeth return to their starting alignment after 72 tooth contacts, which is 3 turns of the 24-tooth gear and 2 turns of the 36-tooth gear. Schedules that repeat every 24 and every 36 days coincide every 72 days. In each case, the GCD tells you the largest block that divides both cycles evenly, and the LCM tells you when they meet again.
Recovering a missing number from the other three
Because the identity links four quantities, any one of them can be found from the other three. Suppose a worksheet gives a = 24, a GCD of 12 and an LCM of 72, and asks for b. Then b = GCD × LCM ÷ a = 864 ÷ 24 = 36. This is handy when a table has a blank cell, or when you want to confirm that a set of printed answers fits together. Try the same idea with a = 18, GCD 6 and LCM 90, which gives b = 540 ÷ 18 = 30. If the division does not come out as a whole number, one of the three given values is wrong, because b must be an integer. The check also catches a typical copying error, where the LCM of one row is paired with the GCD of the next.
Where the identity stops working
The identity does not extend to three numbers. For 4, 6 and 10 the GCD is 2 and the LCM is 60. Their product is 240, but 2 × 60 = 120. The mismatch is a reminder that the rule is a statement about pairs. A second limit is zero: the LCM of zero and any number is conventionally zero, and a product check against zero tells you nothing about the GCD. Negative inputs also need a stated convention. The linked tools return nonnegative GCD and LCM values, so the worksheet keeps both source integers positive. A passing product check is also not a proof for every input. It is evidence for the pair you tested.
Recording the check on a worksheet
A clear record has four lines: the two inputs, the GCD with its reason, the LCM with its reason, and the product comparison. For 24 and 36 that reads: inputs 24 and 36; GCD 12 because 12 divides both and the quotients 2 and 3 share no factor; LCM 72 because 24 × 3 = 36 × 2 = 72; product 12 × 72 = 864 and 24 × 36 = 864. The quotients in the GCD line are a useful extra test. After dividing both numbers by the GCD, the results must have a GCD of 1. If the quotients still share a factor, the GCD you found is too small. The LCM line can be verified the same way by checking that 72 ÷ 24 and 72 ÷ 36 are whole numbers.
Reproduce the checks
GCD
Open the GCD calculator and enter:
- First integer
24- Second integer
36
Expected output:
Greatest common divisor
12Twelve divides both source integers.
LCM
Open the LCM calculator and enter:
- First integer
24- Second integer
36
Expected output:
Least common multiple
72Seventy-two is their smallest positive common multiple.
Product of the outputs
Open the Basic calculator and enter:
- First number
12- Second number
72- Operation
multiply
Expected output:
Result
864This equals the independently computed source product twenty-four times thirty-six.
References and implementation scope
The examples describe the behavior of the linked Computandum tools. A successful local check does not establish that another application accepts the same format or applies the same limits.