Factor math rests on a small set of definitions and one big idea: every whole number has a unique fingerprint made of primes. Once you have that fingerprint, counting factors, finding GCFs, and computing LCMs all become pattern matching.
Definition: What a Factor Is
A factor of n is an integer that divides n evenly, leaving a remainder of 0. So 4 is a factor of 12 because 12 ÷ 4 = 3 with no remainder. 5 is not a factor of 12 because 12 ÷ 5 = 2 remainder 2. Every positive integer has at least two factors, 1 and itself. The words factor and divisor mean the same thing in this context.
Finding All Factors of a Number
You only have to check integers from 1 up to √n. For every i that divides n, both i and n ÷ i are factors, so you get two factors per check. Stop at √n because beyond that point you would just be listing pairs you already found in reverse.
Worked example: factors of 36
√36 = 6, so check i = 1, 2, 3, 4, 5, 6.
i = 1 → 36 ÷ 1 = 36 pair: (1, 36)
i = 2 → 36 ÷ 2 = 18 pair: (2, 18)
i = 3 → 36 ÷ 3 = 12 pair: (3, 12)
i = 4 → 36 ÷ 4 = 9 pair: (4, 9)
i = 5 → 36 ÷ 5 = 7.2 skip (not a factor)
i = 6 → 36 ÷ 6 = 6 pair: (6, 6)
Factors of 36 = {1, 2, 3, 4, 6, 9, 12, 18, 36} (9 factors)Factor Pairs
Every factor below √n pairs with exactly one factor above √n. The only exception is a perfect square, where √n pairs with itself (like 6 × 6 = 36 above). That is why perfect squares always have an odd number of factors, and every other number has an even number of factors.
Number of Factors Formula
Once you have the prime factorization, counting factors is a multiplication. If n = p₁^a × p₂^b × p₃^c × ..., then the number of factors equals (a+1)(b+1)(c+1)... You add 1 to each exponent and multiply.
Example 1: 360 = 2³ × 3² × 5¹
Count = (3+1)(2+1)(1+1) = 4 × 3 × 2 = 24 factors.
Example 2: 100 = 2² × 5²
Count = (2+1)(2+1) = 9 factors.
Example 3: 1,000,000 = 2⁶ × 5⁶
Count = (6+1)(6+1) = 49 factors.
Prime Factorization by Trial Division
Divide out the smallest prime that works, repeat.
360 ÷ 2 = 180
180 ÷ 2 = 90
90 ÷ 2 = 45
45 ÷ 3 = 15
15 ÷ 3 = 5
5 is prime, stop.
360 = 2 × 2 × 2 × 3 × 3 × 5 = 2³ × 3² × 5GCD / GCF / HCF: Greatest Common Divisor
The greatest common divisor (also called greatest common factor or highest common factor) of two numbers is the largest integer that divides both. The cleanest way to find it is from their prime factorizations: take every prime they share, raise it to the smaller of the two exponents, and multiply.
Worked example: GCD(48, 36)
48 = 2⁴ × 3¹
36 = 2² × 3²
Shared primes: 2 and 3.
Smallest exponent of 2 is 2 → 2² = 4
Smallest exponent of 3 is 1 → 3¹ = 3
GCD(48, 36) = 4 × 3 = 12
LCM: Least Common Multiple
The least common multiple of two numbers is the smallest positive integer divisible by both. Take every prime that appears in either factorization and raise it to the larger exponent.
Worked example: LCM(6, 8)
6 = 2¹ × 3¹
8 = 2³
Largest exponent of 2 is 3 → 2³ = 8
Largest exponent of 3 is 1 → 3¹ = 3
LCM(6, 8) = 8 × 3 = 24
Shortcut: LCM(a, b) = (a × b) ÷ GCD(a, b)
= (6 × 8) ÷ 2 = 48 ÷ 2 = 24Divisibility Rules (for Mental Checks)
- Divisible by 2: the last digit is 0, 2, 4, 6, or 8.
- Divisible by 3: the sum of the digits is divisible by 3. 357 → 3+5+7 = 15, divisible by 3.
- Divisible by 4: the last two digits form a number divisible by 4. 1,316 ends in 16, so yes.
- Divisible by 5: the last digit is 0 or 5.
- Divisible by 6: divisible by both 2 and 3.
- Divisible by 9: the sum of the digits is divisible by 9. 729 → 7+2+9 = 18.
- Divisible by 10: the last digit is 0.
- Divisible by 11: the alternating digit sum is divisible by 11. 2,728 → 2−7+2−8 = −11, so yes.
Quick Reference: Factors of Common Numbers
| n | Factors | Count |
|---|
| 1 | 1 | 1 |
| 6 | 1, 2, 3, 6 | 4 |
| 12 | 1, 2, 3, 4, 6, 12 | 6 |
| 24 | 1, 2, 3, 4, 6, 8, 12, 24 | 8 |
| 36 | 1, 2, 3, 4, 6, 9, 12, 18, 36 | 9 |
| 48 | 1, 2, 3, 4, 6, 8, 12, 16, 24, 48 | 10 |
| 60 | 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60 | 12 |
| 100 | 1, 2, 4, 5, 10, 20, 25, 50, 100 | 9 |
| 144 | 1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 36, 48, 72, 144 | 15 |
| 360 | 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 18, 20, 24, 30, 36, 40, 45, 60, 72, 90, 120, 180, 360 | 24 |
| 1000 | 1, 2, 4, 5, 8, 10, 20, 25, 40, 50, 100, 125, 200, 250, 500, 1000 | 16 |