Module 3 · Factors and multiples · Lesson 9 of 39

Prime and composite numbers

Every whole number above 1 is either prime or composite.

In this lesson · about 12 minutes

  • Define prime and composite numbers
  • Decide whether a number is prime
  • Use a sieve to find primes

A prime number is a whole number greater than 1 that is divisible only by 1 and itself. 7 is prime: 7 ÷ 2, 7 ÷ 3, 7 ÷ 4, 7 ÷ 5 and 7 ÷ 6 all leave remainders.

A composite number is a whole number greater than 1 that is divisible by something else too. 6 is composite: 6 ÷ 2 = 3.

So to test a number, look for any whole number (other than 1 and itself) that divides it evenly. Find one and it's composite; find none and it's prime. You only need to test up to the number's square root. The numbers 0 and 1 are neither prime nor composite.

Try it · interactive

Find the primes up to 100

This is the Sieve of Eratosthenes. Cross out the multiples of each prime in turn, and the primes are the numbers left standing.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100

Start with 2: keep it, and cross out every other multiple of 2. Then do the same with the next number that is still standing. 1 is neither prime nor composite.

Worked example

Is 21 prime or composite?

Look for a divisor other than 1 and 21.

    Step 0 of 2

    Loading practice…

    Practice sets mastered: 0 of 1

    Tip: master each practice set first (get 5 right in a row).

    Noviq Academy Pre-Algebra is free and for learning. Practice problems are generated fresh each time; if you think an answer is wrong, tell us through the contact page.