Prime Factorization and Divisibility Rules: Quick Tests for 2 Through 12

October 21, 2026

Every integer greater than 1 is either prime (divisible only by 1 and itself) or can be written as a product of primes in exactly one way, apart from order. This is the fundamental theorem of arithmetic. Prime factorization underlies simplifying fractions, finding greatest common divisors and least common multiples, counting divisors, and even modern encryption.

Factoring by hand is much faster if you know the divisibility rules, quick tests that tell you whether a number divides evenly without doing the division.

Skip the math and get your answer instantly:

Open the Fraction Calculator →

Divisibility Rules

By 2: the last digit is even. By 3: the sum of the digits is divisible by 3. By 4: the last two digits form a number divisible by 4. By 5: the last digit is 0 or 5. By 6: divisible by both 2 and 3. By 8: the last three digits form a number divisible by 8. By 9: the sum of the digits is divisible by 9. By 10: the last digit is 0. By 11: the alternating sum of digits is divisible by 11. By 7: double the last digit, subtract it from the rest, and check whether the result is divisible by 7 (repeat if needed).

Example: is 3,960 divisible by 8? The last three digits, 960, divided by 8 are 120, so yes. By 11? Alternating sum: 3 − 9 + 6 − 0 = 0, divisible by 11, so yes. By 9? Digit sum is 18, so yes.

DivisorTestExample
2Last digit even3,960 yes
3Digit sum divisible by 33+9+6+0 = 18, yes
4Last two digits divisible by 460, yes
5Ends in 0 or 5ends in 0, yes
8Last three digits divisible by 8960 ÷ 8 = 120, yes
9Digit sum divisible by 918, yes
11Alternating digit sum divisible by 113-9+6-0 = 0, yes

Factoring 3,960

Divide by the smallest primes in turn. 3,960 ÷ 2 = 1,980; ÷ 2 = 990; ÷ 2 = 495. Now 495 is odd. Digit sum 18, so divisible by 3: 495 ÷ 3 = 165; ÷ 3 = 55. Then 55 = 5 × 11. So 3,960 = 2³ × 3² × 5 × 11. Check: 8 × 9 × 5 × 11 = 3,960. A factor tree shows the same: split into any two factors and keep splitting until all leaves are prime.

The number of divisors of a number with prime factorization p^a × q^b × r^c is (a+1)(b+1)(c+1). For 3,960 = 2³ × 3² × 5¹ × 11¹, the count is 4 × 3 × 2 × 2 = 48 divisors.

GCD and LCM From Factorizations

To find the GCD of two numbers, take each prime to the lowest power it appears in either; for the LCM, take the highest power. For 3,960 = 2³ × 3² × 5 × 11 and 1,260 = 2² × 3² × 5 × 7: GCD = 2² × 3² × 5 = 180. LCM = 2³ × 3² × 5 × 7 × 11 = 27,720. Check: GCD × LCM = 180 × 27,720 = 4,989,600 = 3,960 × 1,260. These are the same operations you use to simplify fractions: 1,260/3,960 reduces by 180 to 7/22.

Primes and Where They Matter

Primes up to 50 are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, and 47. To test whether a number n is prime, check divisibility by primes up to √n: for 191, √191 ≈ 13.8, so test 2, 3, 5, 7, 11, and 13; none divides, so it is prime. Public-key cryptography such as RSA relies on the fact that multiplying two large primes is easy but factoring their product is extremely hard: the keys involve primes hundreds of digits long.

Practice Tips

Memorize the primes up to 50 and the squares up to 20². Always test the small primes first. Use the factorization to simplify fractions, find common denominators, and solve puzzles about gears, schedules, and tiling.

Frequently Asked Questions

What is prime factorization?

Writing a number as a product of prime numbers.

How do I test divisibility by 3 or 9?

Add the digits and check whether the sum is divisible by 3 or 9.

How do I find the number of divisors?

Add 1 to each prime exponent in the factorization and multiply.

How do I find the GCD using factorization?

Multiply the primes common to both numbers, each to the lowest exponent.

Is 1 a prime number?

No. By definition, primes have exactly two distinct divisors.