Every whole number greater than 1 belongs to one of two special groups: prime numbers or composite numbers. Understanding the difference between these two types of numbers is an important skill in mathematics. Prime and composite numbers help us understand how numbers are built and how they relate to one another. In this chapter, you will learn what makes a number prime, what makes a number composite, and how to tell the difference.
Before we can understand prime and composite numbers, we need to know what a factor is. A factor is a number that divides evenly into another number with no remainder.
Think of factors like pieces of a puzzle. If you can fit a certain number of pieces together perfectly to make a whole, then the number of pieces is a factor of the whole.
For example, the number 12 can be divided evenly by 1, 2, 3, 4, 6, and 12. These numbers are all factors of 12 because when you divide 12 by any of them, you get a whole number with no remainder.
Example: Find all the factors of 8.
What numbers divide evenly into 8?
Solution:
We test each number starting from 1:
8 ÷ 1 = 8 (no remainder, so 1 is a factor)
8 ÷ 2 = 4 (no remainder, so 2 is a factor)
8 ÷ 3 = 2 remainder 2 (not a factor)
8 ÷ 4 = 2 (no remainder, so 4 is a factor)
8 ÷ 5 = 1 remainder 3 (not a factor)
8 ÷ 6 = 1 remainder 2 (not a factor)
8 ÷ 7 = 1 remainder 1 (not a factor)
8 ÷ 8 = 1 (no remainder, so 8 is a factor)
The factors of 8 are 1, 2, 4, and 8.
Every whole number has at least two factors: 1 and itself. The number 1 always divides evenly into any number, and any number divides evenly into itself.
A prime number is a whole number greater than 1 that has exactly two factors: 1 and itself. In other words, a prime number can only be divided evenly by 1 and by the number itself.
Let's look at the number 7. The only numbers that divide evenly into 7 are 1 and 7. This means 7 is a prime number.
Here are some examples of prime numbers:
Example: Is 17 a prime number?
Does 17 have exactly two factors?
Solution:
We check if any numbers other than 1 and 17 divide evenly into 17:
17 ÷ 2 = 8 remainder 1 (not a factor)
17 ÷ 3 = 5 remainder 2 (not a factor)
17 ÷ 4 = 4 remainder 1 (not a factor)
17 ÷ 5 = 3 remainder 2 (not a factor)
We can stop here because we have checked enough numbers. The only factors of 17 are 1 and 17.
Therefore, 17 is a prime number.
An important fact: 2 is the only even prime number. All other even numbers can be divided by 2, which means they have more than two factors.
A composite number is a whole number greater than 1 that has more than two factors. This means a composite number can be divided evenly by at least one number other than 1 and itself.
Let's look at the number 6. The factors of 6 are 1, 2, 3, and 6. Since 6 has four factors (more than two), it is a composite number.
Here are some examples of composite numbers:
Example: Is 15 a composite number?
Does 15 have more than two factors?
Solution:
We find the factors of 15:
15 ÷ 1 = 15 (1 is a factor)
15 ÷ 3 = 5 (3 is a factor)
15 ÷ 5 = 3 (5 is a factor)
15 ÷ 15 = 1 (15 is a factor)
The factors of 15 are 1, 3, 5, and 15. That is four factors, which is more than two.
Therefore, 15 is a composite number.
Every composite number can be written as a product of smaller numbers. For example, 15 = 3 × 5, and 12 = 2 × 6.
The number 1 is neither prime nor composite. This is because 1 has only one factor: itself. Remember, a prime number must have exactly two factors, and a composite number must have more than two factors. Since 1 has only one factor, it does not fit into either group.
Here is a helpful way to remember:
To decide whether a number is prime or composite, follow these steps:
Example: Is 21 prime or composite?
How many factors does 21 have?
Solution:
21 is an odd number, so it is not divisible by 2.
Check if 21 is divisible by 3: 21 ÷ 3 = 7 (no remainder)
Since 21 can be divided evenly by 3, it has factors other than 1 and 21.
The factors of 21 are 1, 3, 7, and 21.
Because 21 has more than two factors, 21 is composite.
Example: Is 23 prime or composite?
Does 23 have exactly two factors?
Solution:
23 is an odd number, so it is not divisible by 2.
Check if 23 is divisible by 3: 23 ÷ 3 = 7 remainder 2 (not a factor)
Check if 23 is divisible by 5: 23 ÷ 5 = 4 remainder 3 (not a factor)
Check if 23 is divisible by 7: 23 ÷ 7 = 3 remainder 2 (not a factor)
We do not need to check numbers larger than 7 because they would give quotients smaller than what we have already checked.
The only factors of 23 are 1 and 23.
Therefore, 23 is prime.
It is helpful to know which small numbers are prime and which are composite. Here is a list of the first twenty whole numbers greater than 1:

Notice that prime numbers become less common as numbers get larger, but there is no largest prime number. Mathematicians have proven that there are infinitely many prime numbers.
Sometimes you can tell quickly if a number is composite by using divisibility rules. These rules help you check if a number can be divided evenly by certain numbers without doing long division.
A number is divisible by 2 if it is even (ends in 0, 2, 4, 6, or 8). If a number greater than 2 is divisible by 2, it is composite.
A number is divisible by 3 if the sum of its digits is divisible by 3. For example, 27 has digits 2 and 7. The sum is 2 + 7 = 9, and 9 is divisible by 3, so 27 is divisible by 3. This means 27 is composite.
A number is divisible by 5 if it ends in 0 or 5. If a number greater than 5 ends in 0 or 5, it is composite.
Example: Is 45 prime or composite?
Can we use divisibility rules to decide?
Solution:
45 ends in 5, so it is divisible by 5.
45 ÷ 5 = 9
Since 45 can be divided evenly by 5, it has factors other than 1 and 45.
The factors of 45 include 1, 3, 5, 9, 15, and 45.
Therefore, 45 is composite.
Another helpful way to find factors is to use factor pairs. A factor pair is two numbers that multiply together to give the original number.
For example, the factor pairs of 12 are:
If a number has only one factor pair (1 and itself), it is prime. If it has more than one factor pair, it is composite.
Example: Find all factor pairs of 18.
Is 18 prime or composite?
Solution:
We look for pairs of numbers that multiply to 18:
1 × 18 = 18
2 × 9 = 18
3 × 6 = 18
The factor pairs are (1, 18), (2, 9), and (3, 6).
Since 18 has more than one factor pair, 18 is composite.
Understanding prime and composite numbers is important for many reasons. Prime numbers are like the building blocks of all other numbers. Every composite number can be broken down into prime numbers multiplied together. This is called prime factorization.
Think of prime numbers like the atoms of the number world. Just as all matter is made of atoms, all composite numbers are made of prime numbers.
For example, the number 12 can be written as 2 × 2 × 3. The numbers 2 and 3 are both prime. No matter how you break down 12, you will always end up with the same prime numbers: two 2's and one 3.
Prime and composite numbers are also used in many areas of mathematics, including finding the greatest common factor, finding the least common multiple, simplifying fractions, and even in computer science and cryptography.
Let's review the key ideas:
By mastering prime and composite numbers, you have learned an important concept that will help you understand many other topics in mathematics.