Once an integer is broken into prime factors, several powerful quantities become easy to compute. To count the divisors of a number, write its prime factorization, add 1 to every exponent, and multiply the results. For 12 = 2² × 3¹ this gives (2+1)(1+1) = 6 divisors, and for 360 = 2³ × 3² × 5¹ the divisor count is (3+1)(2+1)(1+1) = 24.
The greatest common divisor of two numbers is built from the prime factors they share, each raised to the lowest exponent that appears. For 12 = 2² × 3 and 18 = 2 × 3², the shared primes 2 and 3 appear with exponents 1 and 1, giving GCD = 2 × 3 = 6. For 48 = 2⁴ × 3 and 180 = 2² × 3² × 5, the same shared primes 2 and 3 appear with minimum exponents 2 and 1, yielding GCD = 2² × 3 = 12. Two numbers are coprime when they share no prime factors, as with 18 and 35, in which case GCD = 1 and LCM = 18 · 35 = 630.
The least common multiple is built the opposite way, taking each prime to the highest exponent across all the numbers. For 12 and 18, this gives 2² × 3² = 36. For three numbers such as 12 = 2² · 3, 15 = 3 · 5, and 20 = 2² · 5, the LCM is 2² · 3 · 5 = 60. A beautiful identity is \[\mathrm{LCM}(a, b) \cdot \mathrm{GCD}(a, b) = a \cdot b,\] so LCM(a, b) = ab / GCD(a, b). To find the smallest positive integer divisible by every integer from 1 to 10, compute LCM(1, 2, …, 10), which equals 2520. Euler's totient function generalizes the coprime count: for \(n\) with factorization \(p_1^{a_1} p_2^{a_2} \cdots\), \[\varphi(n) = n \cdot \left(1 - \tfrac{1}{p_1}\right) \cdot \left(1 - \tfrac{1}{p_2}\right) \cdots.\] Applied to 36 = 2² · 3², this gives \(\varphi(36) = 36 \cdot \tfrac{1}{2} \cdot \tfrac{2}{3} = 12\).