On this concept: Formula

Not sure which lesson to do first? Find your level and get a plan →

Math · Numbers & Quantities · Grade 3-5

Prime Numbers

A prime number is an integer greater than 1 whose only factors are 1 and itself, so it cannot be broken into smaller factors.

p is prime if p>1 and its only positive divisors are 1 and p

Quick Answer

A prime number is an integer greater than 1 whose only factors are 1 and itself, so it cannot be broken into smaller factors. Primes are the building blocks of multiplication: every whole number above 1 is either prime or a product of primes. To test a number, divide it by the small primes 2, 3, 5, 7 and so on; if none divides evenly, it is prime. The first primes are 2, 3, 5, 7, 11 and 13. The number 1 is not prime, and 2 is the only even prime.

Why This Matters

Primes are the pieces every other whole number is built from, so knowing them lets you break numbers apart: 60=2×2×3×5. That is how you simplify fractions, find common denominators and spot shared factors. Primes also guard online passwords and payments: internet codes rely on the fact that multiplying two huge primes is easy, while finding them again from the product is extremely hard.

Intuitive Explanation

Try to set out 6 chairs in equal rows. 2 rows of 3 works, and so does 3 rows of 2. Now try 7 chairs. 2 rows leave 1 chair over, 3 rows leave 1 over, and so do 4, 5 and 6 rows. The only way is 1 long row of 7 (or 7 rows of 1). Numbers like 7, which can only be one long row, are prime. Their only factors are 1 and the number itself.

To check whether a number is prime, divide it by small primes. Take 29. It is odd, so 2 is not a factor. Its digits add to 2+9=11, which is not a multiple of 3, so 3 is not a factor. It doesn't end in 0 or 5, so 5 is not a factor. You can stop there: the next prime is 7, and 7×7=49 is already bigger than 29, so 29 cannot be split into two factors that are both 7 or more. So 29 is prime.

Prime is not the same as odd. 9 is odd, but 9=3×3, so it has three factors (1, 3 and 9) and is not prime. 15 and 21 are odd and not prime either. And 2 is even but prime, because its only factors are 1 and 2. The number 1 is a special case: it has just one factor, so it is neither prime nor composite.

Think of it like this. Primes are the alphabet of multiplication. Every word is spelled from letters, and every whole number above 1 is spelled from primes: 12=2×2×3. Unlike the alphabet, the list of primes never ends; there is always a bigger one.

Core idea. A prime is a whole number bigger than 1 that cannot be split into a product of smaller whole numbers.


When to Use

Think prime when a problem asks whether a number has exactly two factors, whether a number of objects can only be set out in one row, or wants a number's building blocks. To test, divide by 2, 3, 5, 7 and so on until the prime times itself is bigger than the number. If any of them divides evenly, the number is composite. If the question asks for all the primes that multiply to make a number, use prime factorization.

Tip. Ask: Does this number bigger than 1 have exactly two factors — 1 and itself — and no others?

How to Recognize It

Before you call a number prime, check that it is greater than 1, then look for any smaller number above 1 that divides it.

  1. Can the objects only be set out in one row, like 7 chairs that will not make 2 or 3 equal rows?

    Yes means the count is prime. If the objects also fit a rectangle with more than one row, like 8 chairs in 2 rows of 4, the number is composite.

  2. Is the number bigger than 5 and does it end in 0, 2, 4, 5, 6 or 8?

    Then it is not prime, because 2 or 5 divides it. Other numbers can still fool you: 91 is odd and does not end in 5, yet 91=7×13, so keep testing.

  3. Have you tested every prime up to the one whose square is bigger than your number?

    For 97, test 2, 3, 5 and 7; the next prime, 11, has 11×11=121, more than 97, so you can stop and call 97 prime. Any bigger factor would need a smaller partner you already tried.

  4. Is the question asking which primes multiply together to make a number, rather than whether one number is prime?

    Then it is prime factorization, like 30=2×3×5. Testing for prime only gives a yes or no about one number.

Prime Numbers compared with Composite numbers, Odd numbers, and Prime factorization

Prime numbers, composite numbers, odd numbers and prime factorization all deal with what divides a whole number. The deciding question is whether you are counting a number's factors, checking only for 2, or writing a number as primes multiplied together.

Prime Numbers

Meaning
Use this when you must identify whole numbers that have exactly two factors and cannot be broken down further.
Key test
Does this number bigger than 1 have exactly two factors — 1 and itself — and no others?
Formula
p is prime if p>1 and its only positive divisors are 1 and p
Example
Is 29 prime?

Composite numbers

Meaning
Numbers with MORE than two factors — the opposite of prime.
Key test
Use when a number does break into smaller factors.
Formula
n=a×b
Example
12=3×4

Odd numbers

Meaning
Numbers not divisible by 2, which is NOT the same as prime.
Key test
Use when classifying by parity, not factor count.
Formula
2k+1
Example
9 is odd but composite (3×3)

Prime factorization

Meaning
BREAKING a composite into a product of primes, not testing one number.
Key test
Use when expressing a number as primes multiplied.
Formula
n=p1a1⋯pkak
Example
12=22×3

Formula & Notation

p is prime if p>1 and its only positive divisors are 1 and p
p∈Z is prime   ⟺  p>1 and ∀ a,b∈Z+,  p=ab  ⟹  a=1 or b=1. Fundamental Theorem of Arithmetic: every n>1 factors uniquely as n=p1a1p2a2⋯pkak.

How to read it: p typically denotes a prime; primality is tested by checking divisors up to p

Worked Examples

Example 1 — Test for prime

Easy

Is 29 prime?
Show the steps and the answer
  1. Decide which primes to test: 5×5=25 is less than 29, but 7×7=49 is more, so test only 2, 3 and 5.

    If 29 split into two factors, the smaller one would have to be small enough that its square is at most 29.

  2. Test 2 and 5: 29 ends in 9, so it is odd and doesn't end in 0 or 5.

    The last-digit tests settle 2 and 5 without dividing.

  3. Test 3: 2+9=11 is not a multiple of 3, and indeed 29=3×9+2.

    The digit-sum test shows 3 leaves a remainder of 2, so it is not a factor.

  4. Conclude: no prime up to 5 divides 29, so its only factors are 1 and 29.

    Exactly two factors is what makes a number prime.

Answer: Yes, 29 is prime

Takeaway: To test for prime, try primes only until the prime times itself is bigger than the number.

Example 2 — Odd but composite

Standard

Is 9 prime because it is odd?
Show the steps and the answer
  1. Try dividing 9 by small numbers: 9÷3=3 with remainder 0.

    One factor other than 1 and 9 is enough to show 9 is not prime.

  2. List all its factors: 1, 3 and 9.

    Three factors is more than two, so 9 is composite.

  3. Compare 'odd' with 'prime': odd only means that 2 is not a factor.

    A number can avoid 2 and still be divisible by 3, 5 or 7, like 9, 15, 21 and 35.

Answer: No — 9 is composite

Takeaway: Odd only rules out 2 as a factor; prime needs every number except 1 and itself to fail.

Example 3 — Find the mistake: listing the primes under 12

Application

Eli lists all the prime numbers less than 12: "1, 3, 5, 7, 9, 11." Find the mistakes and correct them.
Show the steps and the answer
  1. Check 1: its only factor is 1, so it has one factor, not two.

    A prime needs exactly two different factors, so 1 does not belong.

  2. Check 9: 9=3×3, so its factors are 1, 3 and 9.

    9 is odd but composite; Eli seems to have listed odd numbers instead of primes.

  3. Check the even numbers: 2 has only the factors 1 and 2, so it is prime, while 4, 6, 8 and 10 all have 2 as an extra factor.

    2 is the one even prime, so it must be added to the list.

Answer: 2, 3, 5, 7, 11

Takeaway: 1 is not prime, 2 is, and odd numbers like 9 can be composite: count the factors instead of judging by looks.

Where You'll See It

  • Cicadas that wait a prime number of years

    Some cicadas come out of the ground only every 13 or 17 years, both prime numbers. One idea scientists have suggested is that a prime cycle rarely lines up with predators that peak every few years: a 17-year cicada meets a 4-year predator cycle only once every 68 years.

  • Packing chocolates in a tray

    A shop wants to pack 23 chocolates in a neat rectangular tray with more than one row. It can't: 23 is prime, so the only arrangement is a single row of 23. With 24 chocolates, trays of 2 by 12, 3 by 8 or 4 by 6 all work.

Common Mistakes

  1. The slip: Calling 1 prime

    Instead: a prime needs exactly two factors; 1 has only one, so it is neither prime nor composite.

  2. The slip: Assuming all odd numbers are prime

    Instead: 9, 15, and 21 are odd but composite.

  3. The slip: Forgetting 2 is prime

    Instead: 2 is the only even prime; its only factors are 1 and 2.


Mini Practice

Try these on your own. Tap Reveal when you want to check.

  1. List all the prime numbers less than 20.

    Hint: Test each number from 2 to 19. Does it have a factor other than 1 and itself?

  2. Is 51 a prime number? Explain how you know.

    Hint: Add the digits to test for 3.

  3. Is 37 a prime number? Explain how you know.

    Hint: Test small primes. Once a prime squared is bigger than 37, you can stop.

  4. Write 30 as a product of prime numbers.

    Hint: Split 30 into two factors, then keep splitting until every factor is prime.

  5. You try to arrange 13 square tiles into a rectangle. How many different rectangles can you make, and is 13 prime or composite?

    Hint: Each rectangle uses a factor pair of 13.

  6. Ben says 1 is the smallest prime number. Correct Ben.

    Hint: How many factors must a prime number have?

Want the full set?

50 practice questions for this concept — free to try, every one with a complete worked solution showing the why, not just the answer.

Frequently Asked Questions

Do the prime numbers ever run out?

No. About 2,300 years ago the Greek mathematician Euclid showed why. Multiply some primes together and add 1, for example 2×3×5+1=312\times3\times5+1=31. Dividing the result by any of those primes leaves a remainder of 1, so none of them is a factor. The result is either a new prime or is built from primes not on your list. Either way, there is always another prime.

What are twin primes?

Twin primes are two primes that differ by 2, such as 3 and 5, 11 and 13, or 41 and 43. Apart from 2 and 3, two primes cannot be any closer, because of any two numbers next to each other, one is even. Nobody knows whether twin primes go on forever. Mathematicians have tried to prove it for more than 150 years, and it is still one of the famous unsolved problems in math.

How do people find really big prime numbers?

Computers do it, using clever tests that are much faster than dividing by every smaller prime. The largest prime found by 2024 has more than 41 million digits, so many that printing it would fill thousands of pages. It was found through a project in which volunteers around the world share their computers' spare time. The recent record holders are all a special kind of prime, one less than a power of 2.

Is there a pattern to where primes appear?

Not a simple one, which is part of what makes them interesting. They get rarer as numbers get bigger: there are 25 primes below 100 but only 21 between 100 and 200. Every prime above 3 is one more or one less than a multiple of 6, like 29 and 31, but many numbers next to multiples of 6, such as 25 and 35, are not prime. So that rule helps you guess, never guarantee.

Learning Path

Prime Numbers

You are here

You need Factors (numbers that multiply to make a given number) and Divisibility Intuition (checking for remainder 0) first. Prime Numbers picks out the numbers with exactly two factors, the ones that cannot be split into smaller whole-number factors. Next, Composite Numbers covers every other number above 1, and Prime Factorization writes any number as a product of primes.

See Also