Greatest common divisor and least common multiple of two or more numbers, entered space or comma separated . Both answers are shown against the prime factorisation they come from, with the Euclidean division steps for a pair.
| 2 | 3 | 5 | Factorisation | |
|---|---|---|---|---|
| 48 | 4 | 1 | · | 2^4 × 3 |
| 180 | 2 | 2 | 1 | 2^2 × 3^2 × 5 |
| GCD — min | 2 | 1 | · | 12 |
| LCM — max | 4 | 2 | 1 | 720 |
Take the smallest exponent in each column and you have the GCD; take the largest and you have the LCM. A column holding a dot contributes nothing to the GCD, because that prime is missing from at least one input.
| Step | a | b | a ÷ b | a mod b |
|---|---|---|---|---|
| 1 | 48 | 180 | 0 | 48 |
| 2 | 180 | 48 | 3 | 36 |
| 3 | 48 | 36 | 1 | 12 |
| 4 | 36 | 12 | 3 | 0 |
Each step replaces (a, b) with (b, a mod b). The divisor of the row that finally hits remainder 0 — 12 — is the GCD.
marduc812
© 202620260824_1c411cc