Math Lab
Home/Class VI/Ch 5/Prime and composite numbers

Prime and composite numbers

If factors are the building blocks of a number, then primes are the atoms: numbers so basic that they cannot be broken any further. Every whole number is either a prime or a product of primes , there are no exceptions.

Concept

A prime number is a whole number greater than 11 that has exactly two factors: 11 and itself. The first few primes are:

2,3,5,7,11,13,17,19,23,29,31,37,2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, \dots

A composite number is a whole number greater than 11 that has more than two factors. The first few composites are:

4,6,8,9,10,12,14,15,16,18,20,4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, \dots

What about 11? It has only one factor (itself), so it is neither prime nor composite. It is a special case.

A few quick facts:

  • 22 is the only even prime. Every other even number is divisible by 22, so it has at least three factors (11, 22, and itself).
  • All primes after 22 are odd, but not all odd numbers are prime (e.g. 9=3×39 = 3 \times 3 is composite).
  • There are infinitely many primes. This was proved by Euclid more than 2,0002{,}000 years ago , one of the most elegant proofs in mathematics.
  • Primes thin out but never stop. There are 2525 primes below 100100, and only 44 between 100100 and 113113.

The Sieve of Eratosthenes

How do we find all primes below, say, 100100? The Greek mathematician Eratosthenes invented a beautiful method called the sieve:

  1. Write all numbers from 22 to 100100.
  2. Circle 22. Cross out every other multiple of 22 (i.e. 4,6,8,,1004, 6, 8, \dots, 100).
  3. The next un-crossed number is 33. Circle it, cross out its multiples.
  4. The next is 55. Circle, cross out multiples.
  5. Continue until you have processed every number up to 100=10\sqrt{100} = 10.
  6. All remaining (circled) numbers are prime.

You only need to sieve with primes up to n\sqrt{n}, because any composite n\leq n must have a prime factor n\leq \sqrt{n}.

Why primes matter

Primes are the building blocks of all whole numbers. Just as every word is built from letters, every whole number greater than 11 is built (uniquely) from primes. This is called the Fundamental Theorem of Arithmetic, and it is one of the cornerstones of mathematics.

Primes also have deep modern uses. The encryption that protects bank transactions and online passwords relies on the fact that multiplying two huge primes is easy, but reversing the process (finding the primes from the product) is, with current methods, almost impossibly slow.

Worked examples

Example 1. Is 5151 prime?

  • Try divisors: 51÷3=1751 \div 3 = 17. So 33 is a factor.
  • Factors of 5151: 1,3,17,511, 3, 17, 51. More than two.
  • 5151 is composite.

Example 2. Is 9797 prime?

  • Check primes up to 979.8\sqrt{97} \approx 9.8: that means 2,3,5,72, 3, 5, 7.
  • 9797 is odd, not divisible by 33 (digit sum 1616), does not end in 00 or 55, 97÷7=13.8597 \div 7 = 13.85\dots no.
  • 9797 is prime.

Example 3. Find all primes between 2020 and 3030.

  • Candidates: 21,22,23,24,25,26,27,28,2921, 22, 23, 24, 25, 26, 27, 28, 29.
  • 21=3×721 = 3 \times 7, composite. 2222 even, composite. 2323? Test 2,32, 3: not divisible. 234.8\sqrt{23} \approx 4.8. Prime. 2424 even. 25=5225 = 5^2, composite. 2626 even. 27=3327 = 3^3, composite. 2828 even. 2929? Test up to 295.4\sqrt{29} \approx 5.4, so 2,3,52, 3, 5: not divisible. Prime.
  • Primes: 23,2923, 29.

Example 4. Twin primes are pairs of primes that differ by 22, like (3,5)(3, 5), (5,7)(5, 7), (11,13)(11, 13). List twin primes below 5050.

  • Below 5050: (3,5)(3, 5), (5,7)(5, 7), (11,13)(11, 13), (17,19)(17, 19), (29,31)(29, 31), (41,43)(41, 43).

Try it yourself

  1. List all primes less than 5050.
  2. Is 11 prime? Why or why not?
  3. Is 8787 prime? Show your working.
  4. Find all composites between 3030 and 4040.
  5. Is the sum of two odd primes always even? Why?
  6. List the first 55 primes greater than 5050.
  7. Twin primes: find a pair between 5050 and 8080.
  8. Tricky: are there three primes in a row (each differing by 22) other than 3,5,73, 5, 7? Argue why not.

Activity

Sieve 11100100. On a sheet of paper, draw a 10×1010 \times 10 grid and write numbers 11 to 100100 in it. Cross out 11 (it is not prime). Circle 22, cross out multiples of 22. Then circle the next un-crossed (33) and cross out its multiples. Repeat with 55, then 77. Stop. Every uncrossed number is prime. Count them , you should find exactly 2525 primes below 100100.

Practice quiz

Quick check on this topic.

Quiz
Quick check : Primes and composites
6 questions · pick the best answer
Q1

Which is prime?

Q2

Which is composite?

Q3

Number of primes less than 10:

Q4

Only even prime:

Q5

Is 49 prime?

Q6

Largest prime less than 30: