Back to homeMathematics · Grade 7 · Change subject
Start for free
Math 7 · Mathematics
Numbers · Natural numbers

Prime Numbers

Before you start, make sure you know: Prime numbers (Math 6)
Before you start, make sure you know: Prime factorization (Math 6)

Jayden says, "$143$ must be prime. It's not divisible by $2$, $3$, $5$, or $7$." Is he right? You will be able to settle this in about ten seconds, with no long list of divisions.

Primes, composites, and the Sieve of Eratosthenes

Examples: $7$ is prime (only $1$ and $7$ divide it). $12$ is composite ($1, 2, 3, 4, 6, 12$). The number $2$ is the only even prime, because every other even number is also divisible by $2$.

How do you find all the primes up to some limit? About 2,200 years ago, the Greek mathematician Eratosthenes had a clever idea: instead of testing numbers, cross out the multiples of each prime. Whatever survives is prime.

The numbers 1 to 30 in a grid, with the primes highlighted and the composite numbers and 1 shown in gray. 12345678910 11121314151617181920 21222324252627282930 Highlighted: primes. Gray: crossed out (1 is neither prime nor composite).

The highlighted boxes are the primes $2, 3, 5, 7, 11, 13, 17, 19, 23, 29$. Here is how the sieve produces them.

When can you stop? You only need to cross out multiples of primes $p$ with $p^2 \le$ your limit. For a list up to $30$, you stop after $5$, because $7^2 = 49$ is already bigger than $30$. For a list up to $50$, you also need to cross out the multiples of $7$.

Practice★☆☆Not started
In a strategy video game, you need to classify the energy crystals according to their purity. Crystals with prime numbers give extra energy, while composite numbers must…

In a strategy video game, you need to classify the energy crystals according to their purity. Crystals with prime numbers give extra energy, while composite numbers must be processed.

Classify the following numbers in the table in your notebook:

$11, 15, 23, 27, 31, 39, 42, 47, 51$

39 42 47 31 EXTRA ENERGY Prime Numbers Divisors: 1 and itself 11 23 TO PROCESS Composite Numbers Divisors: More than 2 15 27
Solve
Practice★☆☆Not started
The Sieve of Eratosthenes is an ancient method for finding prime numbers by crossing out the multiples of previous numbers. Look at the following chart of the numbers…

The Sieve of Eratosthenes is an ancient method for finding prime numbers by crossing out the multiples of previous numbers. Look at the following chart of the numbers from $1$ to $20$:

1 2 3 5 7 11 13 17 19 4 6 8 9 10 12 14 15 16 18 20 Prime 4 Multiple 1 Not prime

Copy the grid into your notebook and complete the process up to the number $50$ to identify all the prime numbers less than $50$.

Solve
Practice★★☆Not started
Twin prime numbers are pairs of prime numbers that are separated only by an even number (that is, their difference is $2$). For example, $3$ and $5$ are twin primes. a)…

Twin prime numbers are pairs of prime numbers that are separated only by an even number (that is, their difference is $2$). For example, $3$ and $5$ are twin primes.

  1. a) Find all the pairs of twin prime numbers less than $60$.
  2. b) Is the pair $(21, 23)$ a pair of twin primes? Justify your answer.
Solve

Divisibility rules

To decide whether a number is prime, you need to spot divisors fast. Divisibility rules let you do that without dividing.

Divisible by Rule
$2$ The last digit is $0, 2, 4, 6,$ or $8$.
$3$ The sum of the digits is a multiple of $3$.
$4$ The number formed by the last two digits is a multiple of $4$.
$5$ The last digit is $0$ or $5$.
$6$ It is divisible by both $2$ and $3$.
$9$ The sum of the digits is a multiple of $9$.
$10$ The last digit is $0$.
$11$ The alternating sum of the digits (add, subtract, add, … starting from the right) is $0$ or a multiple of $11$.

Why do these work? Because $10$, $100$, … leave a remainder of $1$ when divided by $3$ or $9$, so only the digit sum matters. And because $100$ is a multiple of $4$, only the last two digits matter for $4$.

Two examples of divisibility rules: the digit sum of 4,185 is 18, and the alternating sum of the digits of 143 is 0. Digit sum (for 3 and 9) 4 + 1 + 8 + 5 = 18 18 is a multiple of 3 and of 9 so 3 and 9 both divide 4,185 Alternating sum (for 11) 3 − 4 + 1 = 0 0 is a multiple of 11 so 11 divides 143
Practice★☆☆Not started
To organize the shelves of a school library, the librarian uses the rules of divisibility. Without performing long division, indicate which of the following numbers are…

To organize the shelves of a school library, the librarian uses the rules of divisibility. Without performing long division, indicate which of the following numbers are divisible by $3$ and which by $5$:

  1. a) $123$
  2. b) $405$
  3. c) $1.020$
  4. d) $715$
Solve
Practice★☆☆Not started
Did you know that prime numbers are used to create security codes on the internet? A secret code is a prime number greater than $40$ and less than $50$. What numbers…

Did you know that prime numbers are used to create security codes on the internet? A secret code is a prime number greater than $40$ and less than $50$. What numbers could the code be? Check your answer using the rules of divisibility.

Solve
Practice★★☆Not started
In an online strategy game, to unlock a chest you need to enter a four-digit key of the form $52X4$. If the system tells you that the key is a number divisible by $3$…

In an online strategy game, to unlock a chest you need to enter a four-digit key of the form $52X4$. If the system tells you that the key is a number divisible by $3$ and by $4$ simultaneously, what are all the possible values that the digit $X$ can take? Reason your answer by applying the corresponding rules of divisibility.

Solve

Testing whether a number is prime

A sieve is great for a list, but what if you only need to test one big number? You can't try every possible divisor. Here is the shortcut.

Why is that enough? If $N = a \cdot b$ and $a \le b$, then $a \cdot a \le a \cdot b = N$, so $a \le \sqrt{N}$. Every composite number therefore has a divisor at or below its square root. If you haven't found one by then, there isn't one.

You don't need a calculator to find the limit. Sandwich $N$ between two perfect squares: $10^2 = 100 < 113 < 121 = 11^2$, so $\sqrt{113}$ is between $10$ and $11$.

Flow chart: to test whether 113 is prime, find the perfect squares around it, test only the primes up to 10, and conclude that 113 is prime. Is 113 prime? 10² = 100 < 113 < 121 = 11² test the primes up to 10: 2, 3, 5, 7 none divides 113, so 113 is prime
Practice★★☆Not started
A messaging app uses a security filter that only allows messages whose identifier is a prime number to pass. Classify the following identifiers into prime numbers or…

A messaging app uses a security filter that only allows messages whose identifier is a prime number to pass. Classify the following identifiers into prime numbers or composite numbers, justifying your decision in each case by finding a divisor other than one and the number itself:

  1. a) $119$
  2. b) $131$
  3. c) $143$
  4. d) $151$
  5. e) $203$
Solve
Practice★★★Not started
Find the value of the digit $X$ so that the number $35X1$ is a prime number. To do this, follow these steps: 1. Apply the rules of divisibility to rule out values of $X$…

Find the value of the digit $X$ so that the number $35X1$ is a prime number. To do this, follow these steps:

  1. Apply the rules of divisibility to rule out values of $X$ that make it divisible by $3$ or $11$.

  2. From the remaining values, use the square root method to check which of them generates a prime number. Bear in mind that you only need to test for divisibility by prime numbers up to the integer part of $\sqrt{35X1}$.

Solve
Practice★★★Not started
A cybersecurity expert is designing an encryption system for a messaging app. The main security key is a number $N$ obtained by multiplying a pair of twin prime numbers…

A cybersecurity expert is designing an encryption system for a messaging app. The main security key is a number $N$ obtained by multiplying a pair of twin prime numbers between $100$ and $110$. However, upon checking the list, he realizes that there are two pairs of twin primes in that interval, so the choice is not unique. To solve the problem, he decides that the key will be the product of the two prime numbers closest to $105$ (one below and one above).

Determine what these two prime numbers are, check with reasoning that they are prime using the square root method, and calculate the value of the security key $N$.

100 105 110 −2 +2 p₁ = ? Lower prime p₂ = ? Upper prime Security key N = p₁ · p₂
Solve

Prime factorization

Every composite number can be written as a product of primes, its prime factorization. This is like finding the "atoms" of the number. Two methods work well.

Factor tree. Split the number into any two factors, then keep splitting each composite factor until every branch ends in a prime.

Factor tree of 90: 90 splits into 9 and 10, which split into 3, 3, 2, and 5, giving 90 equals 2 times 3 squared times 5. 90 9 10 3 3 2 5 90 = 2 · 3 · 3 · 5 = 2 · 3² · 5

Division ladder. Divide by the smallest prime that works, then divide the quotient again, and so on until you reach $1$. (Some problems call this the "vertical line" method.)

Write repeated factors with exponents, and list the primes from smallest to largest, like $2^2 \cdot 3^2 \cdot 5$.

Practice★☆☆Not started
In Math class we are learning to break down numbers into their fundamental building blocks: prime factors. Perform the prime factorization (using the "vertical line") of…

In Math class we are learning to break down numbers into their fundamental building blocks: prime factors. Perform the prime factorization (using the "vertical line") of the following numbers:

  1. a) $24$
  2. b) $60$
  3. c) $100$
Solve
Practice★★☆Not started
Look at the following incomplete factor tree that represents the factorization of a natural number. Your task is to complete it and finally write the prime factorization…

Look at the following incomplete factor tree that represents the factorization of a natural number. Your task is to complete it and finally write the prime factorization of this number using powers of prime factors.

? ? 15 2 ? 3 5 2 2
Solve
Practice★★★Not started
An architect is designing a circular plaza and wants to place streetlights on the edge. The number of streetlights must be a prime number $n$. For the lighting to be…

An architect is designing a circular plaza and wants to place streetlights on the edge. The number of streetlights must be a prime number $n$. For the lighting to be aesthetic, the architect has discovered that if he subtracts 1 from the number of streetlights $(n-1)$, the result must be a number whose prime factorization is $2^3 \cdot 3^2$.

Calculate the value of $n$, justify why it is a prime number and represent the prime factorization of the composite number $(n-1)$ in a factor tree.

n streetlights (n prime) n - 1 2³ 3² 2 2 2 3 3 · · · ·
Solve

Divisors and how many there are

The prime factorization is a recipe for every divisor. A divisor of $12 = 2^2 \cdot 3$ uses $2^0, 2^1,$ or $2^2$, times $3^0$ or $3^1$. Combine every choice:

A grid multiplying the powers of 2 (1, 2, 4) by the powers of 3 (1, 3) to produce the six divisors of 12. 3⁰ = 1 3¹ = 3 2⁰ = 1 2¹ = 2 2² = 4 13 26 412 3 rows × 2 columns = 6 divisors of 12

The grid has $3 \times 2 = 6$ cells. Notice that $3 = 2 + 1$ (the exponent $2$ plus one) and $2 = 1 + 1$. That pattern always works.

Why $a + 1$? The exponent of $p$ in a divisor can be $0, 1, 2, \dots, a$, and that is $a + 1$ choices. Choices for different primes multiply.

Two useful special cases. A prime $p = p^1$ has $1 + 1 = 2$ divisors. A power of a prime $p^k$ has $k + 1$ divisors, for example $3^4 = 81$ has $5$.

Practice★☆☆Not started
A programmer is creating a list of all the divisors of the number $30$ for a security algorithm. Use its prime factorization to find all its natural divisors. Hint:…

A programmer is creating a list of all the divisors of the number $30$ for a security algorithm.

Use its prime factorization to find all its natural divisors.

Hint: Remember that $1$ and the number itself are always divisors.

Solve
Practice★★★Not started
In a rhythmic gymnastics exhibition, there is a group of $p$ gymnasts. The choreographer tries to organize the athletes into rows and columns to form a perfect…

In a rhythmic gymnastics exhibition, there is a group of $p$ gymnasts. The choreographer tries to organize the athletes into rows and columns to form a perfect rectangle, but observes that the only way to do so is by placing them all in a single row. By adding one more gymnast to the group, the total number of people $(p+1)$ becomes a number that has exactly 8 divisors.

If it is known that $40 < p < 60$, identify all possible values of $p$, show that $p$ is a prime number and find all the possible ways to organize the group of $(p+1)$ gymnasts into rectangles of more than one row.

Solve
Practice★★★Not started
A natural number is said to be "special" if it is the product of three distinct prime numbers less than $20$. An example would be $2 \cdot 3 \cdot 5 = 30$. Find the…

A natural number is said to be "special" if it is the product of three distinct prime numbers less than $20$. An example would be $2 \cdot 3 \cdot 5 = 30$.

Find the largest possible "special" number and the smallest possible one. Then, find out how many divisors each of these two numbers has without needing to list them all, using only the exponents of their prime factorization.

Solve

GCF and LCM with prime factorization

Two kinds of problems keep coming up.

How do you tell which one a word problem wants?

Clue in the problem Use
Split into equal groups, nothing left over, as many (or as large) as possible GCF
Two or more things repeat and you want the next time they happen together LCM

With prime factorizations, both are quick.

The reason: a divisor of both numbers can only use primes that both have, and no more of each than the smaller exponent allows. A common multiple must contain at least as much of every prime as either number does.

Table of the prime exponents of 60 and 126, with the smaller exponent giving the GCF 6 and the larger exponent giving the LCM 1,260. Exponent of each prime (0 if it is missing) Prime 60 126 Smaller Larger 22112 31212 51001 70101 GCF = 2 · 3 = 6 LCM = 2² · 3² · 5 · 7 = 1,260
Practice★☆☆Not started
A candy shop wants to pack $20$ strawberry lollipops and $28$ lemon lollipops into identical bags, so that they have the maximum number of lollipops possible without…

A candy shop wants to pack $20$ strawberry lollipops and $28$ lemon lollipops into identical bags, so that they have the maximum number of lollipops possible without mixing them. To do this they must calculate the Highest Common Factor (HCF).

20 Strawberry 5 bags 4 4 4 4 4 28 Lemon 7 bags 4 4 4 4 4 4 4 HCF = ? lollipops/bag

Calculate the HCF of $20$ and $28$ and explain how many lollipops there will be in each bag.

Solve
Practice★☆☆Not started
Two friends are running on a circular track. Ashley takes $8$ minutes to complete a lap and Ethan takes $12$ minutes. If they start together from the finish line, how…

Two friends are running on a circular track. Ashley takes $8$ minutes to complete a lap and Ethan takes $12$ minutes. If they start together from the finish line, how many minutes will pass until they coincide again for the first time at the finish line?

Use the lowest common multiple (LCM) to solve it.

Finish line (t₀=0) Ashley 8 min Ethan 12 min Laps completed (minutes) Start Ashley 0 8 16 Ethan 0 12 Coincidence LCM(8, 12) = ?
Solve
Practice★★☆Not started
A food bank has received a donation of $120$ jars of beans, $150$ gallons of milk and $72$ cans of preserves. They want to prepare the greatest possible number of…

A food bank has received a donation of $120$ jars of beans, $150$ gallons of milk and $72$ cans of preserves. They want to prepare the greatest possible number of identical boxes to distribute to families in need, with nothing left over from any product.

  1. a) How many boxes can they prepare as a maximum?
  2. b) What quantity of each product will each of these boxes contain?
Solve

Coprime numbers and a GCF × LCM shortcut

Coprime numbers need not be prime themselves: $8$ and $15$ are both composite, but $8 = 2^3$ and $15 = 3 \cdot 5$ share nothing. Two different primes are always coprime. When two numbers are coprime, there are no shared primes to "reuse", so the LCM is just their product. For $8$ and $15$, $\text{LCM} = 120$.

There is also a handy relationship for any two numbers.

The product of the GCF and LCM of 60 and 126 equals the product of 60 and 126, both being 7,560. GCF × LCM a × b = 6 × 1,260 = 7,560 60 × 126 = 7,560

Why? Take each prime separately. The GCF gets the smaller exponent and the LCM gets the larger, so together they use both exponents, just like $a$ and $b$ do. This lets you find a missing number.

Practice★★☆Not started
Calculate the numerical value of the numbers $A$ and $B$ from their prime factorizations and, subsequently, find the $m.c.m.(A, B)$ and the $m.c.d.(A, B)$.…

Calculate the numerical value of the numbers $A$ and $B$ from their prime factorizations and, subsequently, find the $m.c.m.(A, B)$ and the $m.c.d.(A, B)$.

$A = 2^{3} \cdot 3^{2} \cdot 5$

$B = 2^{2} \cdot 3 \cdot 5^{2}$

Indicate whether $A$ and $B$ are coprime and explain why based on the result of the highest common factor.

Solve
Practice★★☆Not started
It is known that the highest common factor of two numbers is $m.c.d.(a, b) = 15$ and that their product is $a \cdot b = 6750$. Use the mathematical relationship between…

It is known that the highest common factor of two numbers is $m.c.d.(a, b) = 15$ and that their product is $a \cdot b = 6750$. Use the mathematical relationship between the product of two numbers and their common factors/multiples to find the lowest common multiple of these numbers without needing to calculate them separately.

Solve
Practice★★★Not started
Two comets pass close to Earth periodically. Comet A passes every $p$ years, where $p$ is a prime number. Comet B passes every $q$ years, where $q$ is the next…

Two comets pass close to Earth periodically. Comet A passes every $p$ years, where $p$ is a prime number. Comet B passes every $q$ years, where $q$ is the next consecutive prime number to $p$. It is known that the last time they coincided was $77$ years ago and that this was the first time they were seen since historical records began.

If $p$ and $q$ are two-digit numbers, identify which numbers they are and calculate how many years will have to pass for them to coincide again.

p, q ∈ Primes 2 digits Point of coincidence Earth Comet B (q) Comet A (p) Last coincidence Today Next coincidence 77 years ¿? years Period = LCM(p, q) = p·q
Solve

Back to the start: Jayden tested $2, 3, 5,$ and $7$ and stopped there. But $11^2 = 121 < 143 < 144 = 12^2$, so the square root test says he also has to try $11$. And $143 \div 11 = 13$ exactly, so $143 = 11 \cdot 13$ is composite. The alternating sum $3 - 4 + 1 = 0$ would have told him that $11$ divides $143$ in seconds.

Summary

See all the exercises in this section