GCD and LCM
a = b × q + r, then GCD(a, b) = GCD(b, r)
The GCD by the Euclidean algorithm, with the full chain of divisions displayed: dividend = divisor × quotient + remainder, line after line, down to the last non-zero remainder. That write-up is what exams ask for, not the result alone. The LCM follows from the identity GCD × LCM = a × b, and the fraction a/b is returned simplified. Three integers are accepted; numbers too large to stay exact are refused rather than rounded.
6
- LCM
- 8640
- Simplified fraction
- 45 / 32
Euclidean algorithm
270 = 192 × 1 + 78 192 = 78 × 2 + 36 78 = 36 × 2 + 6 36 = 6 × 6 + 0
The GCD is 6 and the LCM is 8640.
Each line is a Euclidean division: dividend = divisor × quotient + remainder. The divisor and remainder of one line become the dividend and divisor of the next, and the last non-zero remainder is the GCD. This chain is what exams ask for.
For two numbers, GCD × LCM = a × b, always: the two results check each other. For three numbers the identity no longer holds as such; the tool chains the calculations pairwise.
Scientific dossier
What the tool computes, what it assumes, where it stops being valid, and where its data comes from.
Method & formulasa = b × q + r, then GCD(a, b) = GCD(b, r)
a = b × q + r, then GCD(a, b) = GCD(b, r)
GCD × LCM = a × b
a/b simplified = (a ÷ GCD) / (b ÷ GCD)
The Euclidean algorithm replaces the pair (a, b) with (b, r) as long as the remainder is not zero: the last non-zero remainder is the GCD. The identity GCD × LCM = a × b yields the LCM without hunting for multiples, and provides a check: the two results must multiply back to a × b.
- GCD
- · the largest integer dividing both numbers. It simplifies fractions and splits into maximal equal shares.
- LCM
- · the smallest non-zero integer that both numbers divide. It brings fractions to a common denominator and synchronises cycles.
- Coprime
- · GCD equal to 1. The numbers share no common factor; their LCM is their product.
Validity domainThe tool works on positive integers and refuses the rest: decimals (multiply by a power of 10 first), negatives (the GCD is that of the absolute values), and numbers beyond 90,000,000, because the LCM can reach the product of the inputs and would leave the machine's exact integers.
The tool works on positive integers and refuses the rest: decimals (multiply by a power of 10 first), negatives (the GCD is that of the absolute values), and numbers beyond 90,000,000, because the LCM can reach the product of the inputs and would leave the machine's exact integers. GCD(0, b) is b by convention; GCD(0, 0) does not exist.
Reading the resultThe Euclidean chain is the real deliverable: each line is a Euclidean division whose divisor and remainder slide one notch to the next line.
The Euclidean chain is the real deliverable: each line is a Euclidean division whose divisor and remainder slide one notch to the next line. On an exam paper you write exactly these lines then conclude "the last non-zero remainder is 6, so GCD(270, 192) = 6". The LCM serves the other half of the exercises: common denominators, and cycle problems that resynchronise (two buses leaving together leave together again after the LCM of their periods).