Skip to content

Prime and composite numbersGo deeperabout 55 min

Why it all works: proofs about primes

Unique factorisation, the square-root rule, the reasons behind divisibility tests, and Euclid’s endless primes

Prove that every number is built from primes in exactly one way, see a world where that fails, count factors from a factorisation, explain the square-root rule and every divisibility test, follow Euclid’s proof that primes never end, and prove facts about co-primes and twin primes.

Start at chapter 1

In this part you’ll

  • Explain why every number above 1 has a prime factorisation and why it is unique (the Fundamental Theorem of Arithmetic).
  • Use index form to count factors, test for squares and cubes, and decide divisibility.
  • Explain why trial division and the sieve can stop at the square root.
  • Explain why the divisibility tests for 2, 3, 4, 5, 6, 8, 9, 10 and 11 work, and use a test for 7.
  • Retell Euclid’s proof that there are infinitely many primes, and prove simple facts about co-primes and twin primes.

In the earlier layers you used facts about primes: every number splits into primes; you only test up to the square root; digit sums test for 3 and 9; there are infinitely many primes. This layer asks the question a mathematician always asks next: why?

You will meet some of the most beautiful short arguments in mathematics, several of them over 2,000 years old. None needs more than multiplication, division and careful thinking. The aim is not to memorise these arguments but to understand them well enough to explain them to someone else, and to know exactly where each one would break if a small detail were changed.

Chapter 01

Every number is built from primes

Claim: every counting number bigger than 1 is either prime or a product of primes.

Why: take any number n bigger than 1. Look at its smallest factor that is bigger than 1; call it p.

  • p must be prime. If p were composite, it would have a smaller factor bigger than 1, and that smaller factor would also divide n. But p was the smallest. Contradiction.
  • So n = p × m for some m. If m = 1, then n = p is prime and we are done. Otherwise, m is smaller than n, and we repeat the same step on m.
  • The numbers keep getting smaller (n, then m, then …), and a sequence of counting numbers cannot shrink forever. So the process stops, and when it does, we have written n as a product of primes.

This is exactly what a factor tree or division ladder does. The argument shows it always finishes.

Worked example

0 / 5 steps shown

Smallest prime factor, again and again

Write 5,040 as a product of primes by always dividing by the smallest prime factor.

Lab

Factorise larger numbers with factor trees, choosing different first splits, and confirm the leaves never change.

Round 1 / 9★ 0 ptsBest: 0
360

Key: double green ring = prime leaf · dashed = still to do · thick amber ring = the branch you’re working on.

Choose two numbers that multiply to make 360.

Split 360 into a factor pair:

Wrong tries on this tree: 0

Text version of this activity

This lab offers nine bigger numbers. Build each tree in more than one way (for example, start 3,600 as 60 × 60, then as 36 × 100, then as 2 × 1,800) and compare the prime leaves.

  • 360 = 2³ × 3² × 5 (24 factors)
  • 1,001 = 7 × 11 × 13 (8 factors)
  • 1,729 = 7 × 13 × 19 (8 factors)
  • 2,310 = 2 × 3 × 5 × 7 × 11 (32 factors)
  • 3,600 = 2⁴ × 3² × 5² (45 factors)
  • 4,096 = 2¹² (13 factors)
  • 5,040 = 2⁴ × 3² × 5 × 7 (60 factors)
  • 7,776 = 2⁵ × 3⁵ (36 factors)
  • 9,999 = 3² × 11 × 101 (12 factors)

1,729 = 7 × 13 × 19 is Ramanujan’s famous taxi-cab number. 4,096 is 2 multiplied by itself 12 times. 2,310 is the product of the first five primes.

Need a different angle?

Chapter 02

Only one way: the Fundamental Theorem of Arithmetic

In Understand you saw that 60 always ends up as 2 × 2 × 3 × 5, however you start the tree. This is not luck. It is a theorem so important that it is called the Fundamental Theorem of Arithmetic:

Every counting number bigger than 1 can be written as a product of primes in exactly one way, apart from the order of the factors.

Chapter 1 proved the "can be written" part. The "exactly one way" part rests on a key fact about primes, first written down by Euclid:

Euclid's lemma. If a prime p divides a product a × b, then p divides a or p divides b (or both).

For example, 7 divides 42 × 5 = 210, and 7 divides 42. 3 divides 4 × 15, and 3 divides 15. This is false for composites: 6 divides 4 × 9 = 36, but 6 divides neither 4 nor 9. The 2 in 6 hides in the 4 and the 3 hides in the 9. A prime cannot be split up like that.

Why uniqueness follows: suppose a number had two different prime recipes. Take any prime p in the first recipe. It divides the number, so by Euclid's lemma (used repeatedly) it divides one of the primes in the second recipe. But a prime's only factors are 1 and itself, so p must be that prime. Cancel it from both recipes and repeat. Every prime pairs off, so the recipes were the same all along.

Uniqueness is not automatic. To see why it is special, imagine a world where the only numbers are the even numbers 2, 4, 6, 8, … In that world, call an even number an "E-prime" if it cannot be written as a product of two smaller even numbers.

  • 4 = 2 × 2, 8 = 2 × 4 and 12 = 2 × 6 are not E-prime.
  • 2, 6, 10, 14, 18, 22, 26, 30, … (the numbers that leave remainder 2 when divided by 4) are E-prime: two even numbers multiply to a multiple of 4, so these can never be made.

Now factorise 60 in the even world: 60 = 2 × 30 and 60 = 6 × 10. Both are products of E-primes, and they are different! Also 180 = 2 × 90 = 6 × 30 = 10 × 18. In the even world, factorisation is not unique. Our ordinary numbers are special because Euclid's lemma holds for them.

Try it

A number n is not divisible by 7. Which of these could be divisible by 7?

Worked example

0 / 4 steps shown

Can a power of 2 ever end in 0?

Is there any number of the form 2 × 2 × 2 × … × 2 whose last digit is 0?

Chapter 03

What a factorisation tells you

Once a number is written in index form, many questions become quick.

Which numbers divide it? A number d divides n exactly when every prime in d appears in n at least as many times. So 12 = 2² × 3 divides 360 = 2³ × 3² × 5, but 16 = 2⁴ does not (360 has only three 2s).

How many factors? Every factor of 360 is 2^a × 3^b × 5^c, where a can be 0, 1, 2 or 3 (4 choices), b can be 0, 1 or 2 (3 choices) and c can be 0 or 1 (2 choices). Different choices give different factors (because factorisation is unique!), so there are 4 × 3 × 2 = 24 factors. In general, add 1 to each power and multiply.

Is it a perfect square? A square has every power even: 3,600 = 2⁴ × 3² × 5² = 60 × 60. That is why squares have an odd number of factors: each (even power + 1) is odd, and odd × odd × … is odd.

Is it a perfect cube? Every power is a multiple of 3: 7,776 = 2⁵ × 3⁵ is not a cube, but 2⁶ × 3³ = 1,728 = 12 × 12 × 12 is.

n = p^a × q^b × r^c
Index form with different primes p, q, r
factors = (a+1)(b+1)(c+1)
Each prime’s power can be chosen from 0 up to its power in n
360 = 2³ × 3² × 5
(3+1)(2+1)(1+1) = 24 factors
p prime: 2 factors
p = p¹, so (1+1) = 2. This is the definition of prime again
p²: 3 factors
Squares of primes (4, 9, 25, 49, …) have exactly 1, p and p²

Worked example

0 / 5 steps shown

How many factors does 3,600 have, and how many are odd?

Use 3,600 = 2⁴ × 3² × 5².

Worked example

0 / 4 steps shown

Reading divisibility from index form

N = 2⁴ × 3² × 5 = 720. Without dividing, decide whether N is divisible by 12, 16, 25 and 45.

Lab

Use the add-one-and-multiply rule to match factorisations with their number of factors.

Match each prime factorisation with the number of factors it has.

8 pairs are hiding in two mixed-up columns. Pick one from each side to join them.

Text version of this activity

This connect game pairs 8 prime factorisations with 8 factor counts. Use the rule: add 1 to each power and multiply.

  • 2⁵ (= 32) → 6 factors
  • 2 × 3 × 5 (= 30) → 8 factors
  • 2² × 3² (= 36) → 9 factors
  • 3 × 7 (= 21) → 4 factors
  • 2² × 3 × 5 (= 60) → 12 factors
  • 2⁴ × 3 (= 48) → 10 factors
  • 2⁶ (= 64) → 7 factors
  • 2 × 3 × 5 × 7 (= 210) → 16 factors

Notice that 2⁶ = 64 and 2² × 3² = 36 are squares, so their factor counts, 7 and 9, are odd. 2 × 3 × 5 × 7 = 210 has 2 × 2 × 2 × 2 = 16 factors even though it is not very big.

Need a different angle?

Try it

Worked example

0 / 5 steps shown

Unique factorisation proves √2 is not a fraction

Show that no fraction a⁄b (whole numbers) can satisfy (a⁄b) × (a⁄b) = 2.

Need a different angle?

Try it

Helps you understand

HCF and LCM

Prime factorisations give the HCF (lowest powers of shared primes) and the LCM (highest powers of all primes) in one step.

Chapter 04

Why the square root is enough

Claim: if n is composite, then n has a prime factor p with p × p ≤ n.

Why: n composite means n = a × b, where a and b are both bigger than 1 and a ≤ b. Then a × a ≤ a × b = n. So a ≤ √n. The smallest prime factor of a is at most a, and it divides n too. So n has a prime factor no bigger than √n.

Turned round: if no prime up to √n divides n, then n cannot be composite, so it is prime. That is the trial-division rule.

The same argument explains the sieve. When you sieve with a prime p, every multiple k × p with k smaller than p has a prime factor smaller than p (a factor of k), so it was already crossed out. The first multiple p has to deal with is p × p. And once p × p passes the end of the grid, there is nothing left to do.

TableSieving 1 to 200: each prime starts at its square and removes fewer new numbers
PrimeStarts atNew numbers crossed outHow many
244, 6, 8, … 20099
399, 15, 21, … 195 (odd multiples of 3)32
52525, 35, 55, 65, 85, 95, 115, 125, 145, 155, 175, 18512
74949, 77, 91, 119, 133, 1616
11121121, 143, 1873
131691691
17289nothing: 289 is past 2000

Lab

Sieve all the way to 200 and check that the last prime needed is 13, because 17 × 17 is past 200.

Start by crossing out 1. It has only one factor (itself), so it is not prime.

Legend: circled green with bold number = prime · faded with a slash = crossed out (not prime). We only need to sieve with primes up to √200 ≈ 14.1, because any composite number up to 200 has a factor no bigger than that.

Text version of this activity

The lab shows 1 to 200 in rows of 10. Sieve in order:

  • 2 crosses out 99 numbers; 3 crosses out 32 more; 5 crosses out 12 more; 7 crosses out 6 more (49, 77, 91, 119, 133, 161).
  • 11 crosses out only 121, 143 and 187. 13 crosses out only 169 = 13 × 13.
  • 17 crosses out nothing new, because 17 × 17 = 289 is more than 200.

That leaves 200 − 1 − 99 − 32 − 12 − 6 − 3 − 1 = 46 primes. The last six primes up to 200 are 173, 179, 181, 191, 193 and 197, and the final one is 199.

When you circle the survivors, notice the composites the sieve caught between 100 and 200 that look prime: 119 (7 × 17), 133 (7 × 19), 143 (11 × 13), 161 (7 × 23), 169 (13 × 13) and 187 (11 × 17).

Need a different angle?

Predict first

To test whether 997 is prime, what is the largest prime you need to try?

Try it

Chapter 05

Why the divisibility rules work

Every divisibility rule comes from two facts.

  1. Place value. 7,128 means 7 × 1,000 + 1 × 100 + 2 × 10 + 8.
  2. Sharing a divisor. If d divides two numbers, it divides their sum and their difference. So if d divides one part of a number, d divides the whole exactly when it divides the rest.

Rules for 2, 5 and 10. 10 = 2 × 5, so every multiple of 10 is divisible by 2, 5 and 10. Write 7,128 = 7,120 + 8. The 7,120 part is a multiple of 10, so only the last digit, 8, decides. 8 is even, so 7,128 is divisible by 2 but not by 5 or 10.

Rule for 4. 100 = 4 × 25, so every multiple of 100 is divisible by 4. Write 7,128 = 7,100 + 28. Only the last two digits decide: 28 = 4 × 7. ✓ (The same reasoning gives a rule for 25: look at the last two digits.)

Rule for 8. 1,000 = 8 × 125. Write 15,128 = 15,000 + 128. Only the last three digits decide: 128 = 8 × 16. ✓

Rules for 3 and 9. The key fact is that 10 is one more than 9. So

  • 10 = 9 + 1
  • 100 = 99 + 1
  • 1,000 = 999 + 1

and 9, 99, 999, … are all multiples of 9 (and of 3). Now write 7,128 like this:

7 × 1,000 + 1 × 100 + 2 × 10 + 8 = 7 × (999 + 1) + 1 × (99 + 1) + 2 × (9 + 1) + 8 = (7 × 999 + 1 × 99 + 2 × 9) + (7 + 1 + 2 + 8).

The first bracket is a multiple of 9. The second bracket is the digit sum, 18. So 7,128 and its digit sum leave the same remainder when divided by 9 (or by 3). Divisible by 9 exactly when the digit sum is. That is also why a number minus its reverse (same digits, same digit sum) is always a multiple of 9.

Rule for 11. Here the key fact is that 10 is one less than 11. So

  • 10 = 11 − 1
  • 100 = 99 + 1, and 99 = 9 × 11
  • 1,000 = 1,001 − 1, and 1,001 = 91 × 11
  • 10,000 = 9,999 + 1, and 9,999 = 909 × 11

The powers of 10 are alternately 1 more and 1 less than a multiple of 11. So a number leaves the same remainder on division by 11 as its digits added with alternating signs, starting with + on the units digit. For 9,284: 4 − 8 + 2 − 9 = −11, a multiple of 11, so 9,284 = 11 × 844. ✓

Rule for 6. 6 = 2 × 3 and 2, 3 are co-prime. If a number is divisible by 2 and by 3, its prime factorisation contains a 2 and a 3, so it contains 6. With non-co-prime pieces, like 2 and 4, the 2 in 4 might be the same 2, which is why 12 passes both tests for 2 and 4 but fails for 8.

Lab

Match each divisibility test to the place-value fact that makes it work.

Which fact about 10, 100 or 1,000 explains each divisibility test?

10 cards, 4 bins. Tap a card, then tap its bin. You can also drag, or press a bin’s number key.

Text version of this activity

This game has 10 test cards and 4 bins, each a fact about powers of 10.

  • 10 = 2 × 5: the tests for 2, 5 and 10 (look at the last digit only).
  • 10 = 9 + 1: the digit-sum tests for 3 and 9, and the fact that a number minus its reverse is a multiple of 9.
  • 10 = 11 − 1: the alternating-sum test for 11.
  • 100 = 4 × 25 or 1,000 = 8 × 125: the last-two-digits tests for 4 and 25, and the last-three-digits test for 8.

In every case the idea is the same: split the number into a part that is certainly a multiple of the divisor and a small part that decides the answer.

Need a different angle?

Chapter 06

A test for 7 (and 13)

There is no digit-sum test for 7, because 10 is neither 1 more nor 1 less than a multiple of 7. But there are two good tricks.

Chop and double. Remove the last digit, double it, and subtract it from what is left. Repeat until the number is small. The original is divisible by 7 exactly when the result is.

Why it works: write the number as 10a + b (b is the last digit). The trick gives a − 2b. Now 2 × (10a + b) = 20a + 2b, and 20a + 2b + (a − 2b) = 21a, a multiple of 7. So 10a + b and a − 2b are either both multiples of 7 or neither (7 does not divide 2).

Use 1,001. 1,001 = 7 × 11 × 13. Split the number into groups of three digits from the right and add and subtract them alternately (because 1,000 is one less than 1,001). The result is divisible by 7, 11 or 13 exactly when the original is. For 7,028,011: 11 − 28 + 7 = −10, so it is not divisible by 7, 11 or 13.

Worked example

0 / 4 steps shown

Is 3,794 divisible by 7?

Use chop and double.

Chapter 07

Euclid: the primes never end

Around 300 BCE, the Greek mathematician Euclid of Alexandria wrote the Elements, a set of thirteen books that was used to teach mathematics for over 2,000 years. In Book IX he proved that there is no largest prime. His argument is short enough to fit on a postcard.

Claim: there are more primes than any list you can make.

Why: suppose someone hands you a finite list of primes, say 2, 3, 5 and 7. Multiply them all together and add 1:

N = 2 × 3 × 5 × 7 + 1 = 211.

Now look at N.

  • Dividing N by 2 leaves remainder 1 (N is one more than a multiple of 2).
  • Dividing N by 3 leaves remainder 1. The same happens for 5 and for 7.
  • So none of the primes on the list divides N.
  • But N is bigger than 1, so it has at least one prime factor (Chapter 1).
  • That prime factor is therefore not on the list.

The list was missing a prime. This works for any finite list, so no finite list can contain every prime. There are infinitely many primes.

A second proof, found in 2006. The mathematician Filip Saidak noticed a proof that uses only one fact from this topic: consecutive numbers are co-prime.

Start with any number, say 2. Multiply it by the next number: 2 × 3 = 6. Since 2 and 3 are co-prime, 6 has at least two different prime factors.

Now do it again with 6: 6 × 7 = 42. Since 6 and 7 are co-prime, 7 brings at least one prime that is not in 6. So 42 has at least three different prime factors (2, 3, 7).

Again: 42 × 43 = 1,806 = 2 × 3 × 7 × 43. At least four primes. Then 1,806 × 1,807 has at least five, because 1,807 = 13 × 139 shares no prime with 1,806.

Each step adds at least one new prime, and you can take as many steps as you like. So there must be infinitely many primes.

Worked example

0 / 4 steps shown

Running Euclid’s machine

Start with the list {3, 7}. Use Euclid’s method to find a prime not on it.

Predict first

Your list is {2, 3, 5, 7, 11, 13}, and N = 30,031. Which of these statements is definitely true?

Chapter 08

Co-primes: why they behave so well

Co-prime means no shared prime. By unique factorisation, the common factors of two numbers are built from the primes they share. So HCF = 1 exactly when their factorisations have no prime in common. 8 = 2³ and 15 = 3 × 5 share no prime, so they are co-prime. That is the fastest test.

Consecutive numbers are co-prime. If d divides both n and n + 1, it divides their difference, 1. So d = 1.

The product rule. If a and b are co-prime and both divide n, then a × b divides n. Reason: a's primes appear in n, and b's primes appear in n; since they share no primes, they are different primes and all of them appear in n together. This is exactly why the test for 6 (2 and 3), 12 (3 and 4), 15 (3 and 5), 18 (2 and 9) and 24 (3 and 8) works, and why it fails for non-co-prime pieces.

Fractions in lowest terms. A fraction like 8⁄15 is in its simplest form exactly when the top and bottom are co-prime.

Worked example

0 / 5 steps shown

Is 2,376 divisible by 24?

Use the product rule with co-prime pieces.

TableHow many numbers from 1 to n are co-prime with n? (Euler’s totient, written φ(n))
nCo-prime numbers from 1 to nHow manyNote
1111 is co-prime to itself
51, 2, 3, 44prime: n − 1
61, 52
71, 2, 3, 4, 5, 66prime: n − 1
81, 3, 5, 74
91, 2, 4, 5, 7, 86
101, 3, 7, 94
111, 2, 3, 4, 5, 6, 7, 8, 9, 1010prime: n − 1
121, 5, 7, 114

Chapter 09

Twin prime facts you can prove

Nobody can prove that twin primes go on forever, but several facts about them are easy to prove.

1. After (3, 5), twin primes are 6k − 1 and 6k + 1. The middle number of twins p and p + 2 is even (it lies between two odd numbers). One of p, p + 1, p + 2 is a multiple of 3, and it cannot be p or p + 2 (they are primes bigger than 3). So the middle is a multiple of 2 and of 3, and since 2 and 3 are co-prime, a multiple of 6.

2. The sum of twin primes (after 3, 5) is a multiple of 12. p + (p + 2) = 2 × (p + 1) = 2 × 6k = 12k. Check: 17 + 19 = 36 = 12 × 3; 71 + 73 = 144 = 12 × 12.

3. The product of twin primes, plus 1, is a perfect square. p × (p + 2) + 1 = p × p + 2 × p + 1 = (p + 1) × (p + 1). Check: 11 × 13 + 1 = 144 = 12 × 12; 29 × 31 + 1 = 900 = 30 × 30.

4. The only prime triplet is 3, 5, 7. One of n, n + 2, n + 4 is always a multiple of 3 (check the three possible remainders), so for all three to be prime, that one must be 3.

Try it

Chapter 10

The long story of primes

Two thousand years of prime numbers

  1. c. 300 BCE
    Euclid’s Elements Euclid proves there are infinitely many primes and lays the groundwork for unique factorisation (Euclid’s lemma).
  2. c. 240 BCE
    Eratosthenes’ sieve Eratosthenes of Cyrene, librarian at Alexandria, describes the sieve for listing primes.
  3. 1640
    Fermat Pierre de Fermat states his "little theorem" about primes and the two-squares result for 4k + 1 primes.
  4. 1644
    Mersenne Marin Mersenne, a French friar, publishes a list of exponents p for which he claimed 2ᵖ − 1 is prime; it contained errors.
  5. 1737
    Euler Leonhard Euler gives a new proof that primes never end and links primes to the sum 1 + ½ + ⅓ + …
  6. 1742
    Goldbach In letters between Christian Goldbach and Euler appears the guess that every even number above 2 is a sum of two primes. Still unproved.
  7. 1801
    Gauss Carl Friedrich Gauss gives the first complete proof that prime factorisation is unique.
  8. 1896
    Prime Number Theorem Hadamard and de la Vallée Poussin prove that the primes up to n number roughly n divided by its natural logarithm.
  9. 1915
    Ramanujan Srinivasa Ramanujan publishes his long paper on highly composite numbers, the opposite of primes.
  10. 2002
    AKS test Manindra Agrawal, Neeraj Kayal and Nitin Saxena at IIT Kanpur find the first fast, always-correct primality test.
  11. 2013
    Bounded gaps Yitang Zhang proves infinitely many prime pairs differ by less than 70 million; others soon cut this to 246.
  12. 2024
    Largest known prime A GIMPS volunteer finds 2¹³⁶²⁷⁹⁸⁴¹ − 1, a prime with over 41 million digits.

Chapter 11

Edge cases and careful thinking

Words for proofs

theorem
A statement that has been proved true.
Example: There are infinitely many primes.
lemma
A smaller result used as a stepping stone to prove a theorem.
Example: Euclid’s lemma
Fundamental Theorem of Arithmetic
Every number bigger than 1 is a product of primes in exactly one way, apart from order.
Example: 60 = 2² × 3 × 5 only
Euclid’s lemma
If a prime divides a product, it divides at least one of the numbers multiplied.
Example: 7 divides 42 × 5, and 7 divides 42.
proof by contradiction
Showing something is true by assuming it is false and reaching an impossibility.
Example: Assume there is a last prime…
infinitely many
More than any number you can name; the list never ends.
perfect square
A number that is a whole number multiplied by itself. All powers in its factorisation are even.
Example: 3,600 = 2⁴ × 3² × 5²
perfect cube
A whole number multiplied by itself three times.
Example: 1,728 = 12³
Euler’s totient φ(n)
How many numbers from 1 to n are co-prime with n.
Example: φ(10) = 4: 1, 3, 7, 9
remainder
What is left after exact division. Two numbers with the same remainder on division by d differ by a multiple of d.
Example: 17 and 2 both leave 2 on dividing by 5.
unit
A number that divides every number. Among counting numbers, only 1.
primality test
A method for deciding whether a number is prime.
Example: Trial division; AKS

Quick check

Reasons, not just rules

11 questions · answer what you can, then check. Getting one wrong is useful.

  1. Q1Why is the smallest factor (bigger than 1) of any number always prime?
  2. Q2In the "even world", why does 60 fail to have a unique factorisation?
  3. Q3How many factors does 2³ × 3² × 7 have?
  4. Q4Which of these is a perfect square?
  5. Q5The digit-sum test for 9 works because…
  6. Q6Is 918,082 divisible by 11?
  7. Q7In Euclid’s proof, why can none of the listed primes divide N = (product of the list) + 1?
  8. Q82 × 3 × 5 × 7 × 11 × 13 + 1 = 30,031. What does this example show?
  9. Q9Why is it enough to try primes up to √n when testing n?
  10. Q10The sum of twin primes 59 and 61 is 120. Which is guaranteed for every twin pair after (3, 5)?
  11. Q11Using chop and double, 1,869 → 186 − 18 = 168 → 16 − 16 = 0. What do you conclude?

Reflect

This stays on this page only. It isn’t saved or sent anywhere.

Keep this

Cheat sheet: the reasons

  • Existence: the smallest factor above 1 is always prime; keep dividing and the numbers shrink, so every n above 1 is a product of primes.
  • Euclid’s lemma: a prime dividing a × b divides a or b. False for composites (6 divides 4 × 9).
  • Fundamental Theorem of Arithmetic: each n above 1 has exactly one prime factorisation. In the "even world" this fails: 60 = 2 × 30 = 6 × 10.
  • 1 is not prime so that the theorem stays simple.
  • Number of factors: add 1 to each power and multiply. 360 = 2³ × 3² × 5 → 24 factors. Squares have all powers even.
  • √n rule: in any factor pair a × b = n with a ≤ b, a ≤ √n. The sieve for p starts at p × p.
  • Rules from place value: 10 = 2 × 5; 100 = 4 × 25; 1,000 = 8 × 125; 10 = 9 + 1 (digit sum); 10 = 11 − 1 (alternating sum).
  • Test for 7: 10a + b is divisible by 7 exactly when a − 2b is. Or use 1,001 = 7 × 11 × 13.
  • Euclid (c. 300 BCE): product of any list of primes + 1 has a prime factor not on the list. Infinitely many primes.
  • Co-prime = no shared prime. If co-prime a and b both divide n, then a × b divides n.
  • Twin facts: after (3, 5), twins are 6k ± 1, their sum is a multiple of 12, and their product + 1 is a square.

Where this comes from

Sources

  • prime (opens another website) — Encyclopaedia Britannicaawaiting owner check

    Supports the definition of a prime as a positive integer above 1 divisible only by itself and 1, the fundamental theorem of arithmetic (unique prime factorisation) and primes as multiplicative building blocks, and primes being studied in antiquity by Euclid and Eratosthenes.

  • sieve of Eratosthenes (opens another website) — Encyclopaedia Britannicaawaiting owner check

    Supports the sieve procedure — list the natural numbers in order, strike out 1, then every second number after 2, every third after 3, and so on, leaving the primes — and Eratosthenes of Cyrene (c. 276–194 BCE) as its namesake.

  • Divisibility Rules (opens another website) — Math is Funawaiting owner check

    Supports the divisibility tests for 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 and 12, and the rule that a number divisible by another is divisible by each of that number's factors (6 from 2 and 3; 12 from 3 and 4).

  • Twin prime (opens another website) — Wikipediaawaiting owner check

    Supports the list of twin primes, the twin prime conjecture being unsolved, Yitang Zhang's 2013 bound below 70 million, its reduction to 246 within a year using Maynard's and Polymath's methods, and the record twin primes with 388,342 digits.

  • List of known Mersenne prime numbers (opens another website) — Great Internet Mersenne Prime Search (GIMPS)awaiting owner check

    Supports Mersenne primes of the form 2ⁿ − 1 and the current record: 2^136279841 − 1, 41,024,320 digits, found by Luke Durant on 12 October 2024, the 52nd known Mersenne prime (a provisional rank, as not every smaller candidate has been tested).

  • Ganita Prakash, Class 8, Chapter 5: Number Play (opens another website) — National Council of Educational Research and Training (NCERT)awaiting owner check

    Supports the divisibility tests and the reasons behind them: 10, 5, 2, 4 and 8 from the last digits, 9 and 3 from the digit sum, 11 from the alternating sum, 6 from 2 and 3, and combining tests for co-prime factors; also checking divisibility from prime factorisations.

  • Euclid's theorem (opens another website) — Wikipediaawaiting owner check

    Supports Euclid's proof in Elements Book IX Proposition 20 (a direct argument on any finite list of primes, not a proof by contradiction) and Filip Saidak's 2006 constructive proof using the co-primality of consecutive numbers.

  • AKS primality test (opens another website) — Wikipediaawaiting owner check

    Supports the AKS test: announced as "PRIMES is in P" on 6 August 2002 by Manindra Agrawal, Neeraj Kayal and Nitin Saxena of IIT Kanpur; the first deterministic, unconditional, polynomial-time primality test; Gödel and Fulkerson Prizes in 2006.

End of Go deeper

What you just read

  • Explain why every number above 1 has a prime factorisation and why it is unique (the Fundamental Theorem of Arithmetic).
  • Use index form to count factors, test for squares and cubes, and decide divisibility.
  • Explain why trial division and the sieve can stop at the square root.
  • Explain why the divisibility tests for 2, 3, 4, 5, 6, 8, 9, 10 and 11 work, and use a test for 7.
  • Retell Euclid’s proof that there are infinitely many primes, and prove simple facts about co-primes and twin primes.

The web

Explore a connection

  • Builds on

    Four operations

    Testing whether a number is prime is just careful division: does anything divide it exactly?

  • Helps you understand

    HCF and LCM

    Prime factorisation is the fastest route to both the HCF and the LCM.

  • Contrasts with

    Number and shape patterns

    Primes famously refuse to follow a simple pattern, unlike even numbers, squares or multiples.

Want to save topics or ask for new ones? Invited families can connect a learning device. Everything here stays free to read without signing in.

Revision 1 · release preview-7e1cbbcc4f · accepted 20/09/2026