Greatest common divisor
The greatest common divisor (GCD) of two integers that are not both zero is the largest positive integer that divides both of them. It's their largest shared factor. Like the least common multiple, it can be efficiently found with prime factorizations.
For two integers \(a\) and \(b\), their greatest common divisor is denoted \(\gcd(a, b)\), or equivalently, \(\gcd(b, a).\)
For any integer \(x \neq 0\), \(\gcd(x, 0) = |x|\), which should make sense. Any positive integer divides \(0.\) The largest positive integer that divides \(x\) is its absolute value. Therefore, \(|x|\) is the largest positive integer capable of dividing both \(x\) and \(0.\)
Coprimality
Two positive integers are considered coprime (or "relatively prime") to each other if their greatest common divisor is \(1.\) Here are some notable properties that two integers will have if and only if they are coprime.
- No prime can divide both coprime integers.
- The least common multiple of two coprime integers is their product: \(\text{lcm}(a, b) = a \times b.\)