Greatest common divisors and least common multiples
Let a and b be positive integers.
The greatest common divisor of a and b --- gcd(a,b) --- is the largest
integer that divides both a and b.
The least common multiple of a and b --- lcm(a,b) --- is the smallest
positive integer that is divisible by both a and b.
Theorem. Let the following be factorizations of a and b:
a = p p . . . p b = p p . . . p
(here some of the ai and bi may be 0 or 1).