Back to homeMathematics · 2nd Year · Change subject
Start for free
2nd Year · Mathematics
Numbers · Natural numbers

Prime numbers

Your Second Year class is setting a 3-digit code for the Credit Union savings box at the school sports day, and Aoife says the code $143$ must be prime. How can you tell whether $143$ is prime without trying to divide it by a hundred different numbers? There is a mathematical shortcut that saves you almost all of the work.

The Sieve of Eratosthenes

Sieve of Eratosthenes with the numbers 2 to 12: the multiples of 2, 3 and 5 are crossed out and the primes up to 30 are shown. 2345 6789 101112 Cross out multiples of 2, then of 3, then of 5... What is left uncrossed are the primes. 2, 3, 5, 7, 11... Primes up to 30: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29
Practice★☆☆Not started
In a strategy video game, you need to classify energy crystals according to their purity. Crystals with prime numbers give extra energy, while composite numbers must be…

In a strategy video game, you need to classify 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 Factors: 1 and itself 11 23 TO BE PROCESSED Composite Numbers Factors: 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 earlier numbers. Look at the following grid of numbers from $1$…

The Sieve of Eratosthenes is an ancient method for finding prime numbers by crossing out the multiples of earlier numbers. Look at the following grid of 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 prime numbers less than $50$.

Solve

Checking whether a number is prime

Trying every possible factor of a large number one by one is very slow. There is a shortcut: you only need to test the primes up to the square root.

Diagram illustrating the method for checking whether a number is prime by testing only the prime divisors less than or equal to its square root. Is 143 prime? √143 ≈ 11.9 try 2, 3, 5, 7, 11 143 : 11 = 13 → not prime

Other tests: divisible by $5$ if it ends in $0$ or $5$; by $11$ if the alternating sum of the digits ($1$st $-$ $2$nd $+$ $3$rd $-$ $4$th ...) is $0$ or a multiple of $11$. For $1{,}020$: digit sum $3$, so divisible by $3$; ends in $0$, so divisible by $5$.

Practice★☆☆Not started
To organise the shelves of a school library, the librarian uses divisibility tests. Without carrying out long division, state which of the following numbers are…

To organise the shelves of a school library, the librarian uses divisibility tests. Without carrying out long division, state 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$. Which 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$. Which numbers could be the code? Check your answer using divisibility tests.

Solve
Practice★☆☆Not started
Cian states in Maths class: «The number $91$ is prime because I checked that it is not divisible by $2$ (it is odd), nor by $3$ (its digits add up to $10$), nor by $5$…

Cian states in Maths class: «The number $91$ is prime because I checked that it is not divisible by $2$ (it is odd), nor by $3$ (its digits add up to $10$), nor by $5$ (it does not end in $0$ or $5$). Since I have already tested the first primes, there is no need to continue».\na) Explain the criterion that indicates up to which prime number it is necessary to test divisions to determine with certainty whether a number $N$ is prime.\nb) Up to which prime number should Cian have tested for the number $91$?\nc) Find Cian's mistake, explain why his deduction is false, and determine whether $91$ is prime or composite, justifying your answer with a division.

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

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

Solve
Practice★★☆Not started
A messaging app uses a security filter that only allows messages through if their identifier is a prime number. Classify the following identifiers as prime numbers or…

A messaging app uses a security filter that only allows messages through if their identifier is a prime number. Classify the following identifiers as prime numbers or composite numbers, justifying your decision in each case by finding a factor other than 1 and the number itself:

  1. a) $119$
  2. b) $131$
  3. c) $143$
  4. d) $151$
  5. e) $203$
Solve
Practice★★☆Not started
To check whether the number $173$ is prime, two classmates propose two different strategies:\n- Aoife's strategy: Divide $173$ by all consecutive odd numbers starting…

To check whether the number $173$ is prime, two classmates propose two different strategies:\n- Aoife's strategy: Divide $173$ by all consecutive odd numbers starting from $3$ up to half of the number ($86$), that is: $3, 5, 7, 9, 11, 13, 15, \dots, 85$.\n- Darragh's strategy: Mentally calculate which integers $\sqrt{173}$ lies between, and test dividing $173$ only by the prime numbers that are less than or equal to that square root.\na) Compare both strategies and justify why Darragh's saves effort without losing reliability. In particular, explain why there is no need to test composite numbers such as $9$ or $15$, and why it is safe to stop at the square root.\nb) Apply Darragh's strategy by carrying out the necessary divisions and conclude whether $173$ is prime or composite.

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 reviewing 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 which two prime numbers these are, prove with reasons 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
Practice★★★Not started
Goldbach's conjecture states that every even number greater than 2 can be written as the sum of two prime numbers. Your task is to investigate this conjecture for the…

Goldbach's conjecture states that every even number greater than 2 can be written as the sum of two prime numbers. Your task is to investigate this conjecture for the number $120$.

Find and write down all pairs of prime numbers whose sum is exactly $120$. To prove that the chosen numbers are indeed prime, select the pair whose components are furthest apart from each other and test for divisibility by prime numbers less than $\sqrt{n}$ for each of them.

Solve
Practice★★★Not started
Find the values of the digit $X$ such that the number $35X1$ is a prime number. To do this, follow these steps: 1. Apply the divisibility rules to rule out values of $X$…

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

  1. Apply the divisibility rules 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 generate a prime number. Keep in mind that you only need to test divisibility by prime numbers up to the integer part of $\sqrt{35X1}$.

Solve

Prime factors, HCF, LCM and counting factors

Every natural number greater than $1$ can be written as a product of primes in exactly one way (apart from the order). This is its prime factorisation. You can find it with a factor tree or by repeated division.

The prime factorisation also gives the highest common factor (HCF) and lowest common multiple (LCM). For the HCF take each common prime to its smallest index. For the LCM take every prime to its largest index.

Practice★☆☆Not started
In Maths class we are learning to break numbers down into their basic building blocks: prime factors. Find the prime factorisation (using a vertical bar) of the…

In Maths class we are learning to break numbers down into their basic building blocks: prime factors. Find the prime factorisation (using a vertical bar) of the following numbers:

  1. a) $24$
  2. b) $60$
  3. c) $100$
Solve
Practice★☆☆Not started
A programmer is creating a list of all the factors of the number $30$ for a security algorithm. Use its prime factorisation to find all of its natural factors.

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

Use its prime factorisation to find all of its natural factors.

Solve
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 possible number of lollipops without…

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

In the figure, each division of the bars represents one lollipop.

Two bars divided into cells: one with 20 strawberry lollipops and another with 28 lemon lollipops20Strawberry28Lemon

Calculate the G.C.D. 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. Aoife takes $8$ minutes to complete one lap and Seán takes $12$ minutes. If they start together from the finish line, how…

Two friends are running on a circular track. Aoife takes $8$ minutes to complete one lap and Seán takes $12$ minutes. If they start together from the finish line, how many minutes will pass before they meet again at the finish line for the first time?

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

Finish line (t₀=0) Aoife 8 min Seán 12 min Laps completed (minutes) Start Aoife 0 8 16 Seán 0 12 Coincidence LCM(8, 12) = ?
Solve
Practice★★☆Not started
At a train station in Dublin, three lines coincide at $07:00$ in the morning. Line $L1$ runs every $12$ minutes, line $L2$ every $15$ minutes and line $L5$ every $20$…

At a train station in Dublin, three lines coincide at $07:00$ in the morning. Line $L1$ runs every $12$ minutes, line $L2$ every $15$ minutes and line $L5$ every $20$ minutes. The figure shows the departures of each line during the first $40$ minutes from $07:00$.

Departures of lines L1 (every 12 min), L2 (every 15 min) and L5 (every 20 min) in the first 40 minutes from 07:00, on a time axis from 0 to 70 minutesL1L2L501020304050607007:00Minutes since 07:00
  1. a) How many minutes must pass for them to coincide again for the first time?
  1. b) At what exact time will this meeting take place?
Solve
Practice★★☆Not started
A food bank has received a donation of $120$ jars of pulses, $150$ litres of milk and $72$ tins of food. They want to prepare the maximum possible number of identical…

A food bank has received a donation of $120$ jars of pulses, $150$ litres of milk and $72$ tins of food. They want to prepare the maximum possible number of identical boxes to distribute to families in need, without any of the products left over.

  1. a) What is the maximum number of boxes they can prepare?
  2. b) How much of each product will each box contain?
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 \times 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 \times b = 6750$. Use the mathematical relationship between the product of two numbers and their common factors/multiples to find the lowest common multiple of those numbers without calculating them separately.

Solve
Practice★★☆Not started
Calculate the numerical values of the numbers $A$ and $B$ from their prime factorisations and then find the $m.c.m.(A, B)$ and the $m.c.d.(A, B)$.…

Calculate the numerical values of the numbers $A$ and $B$ from their prime factorisations and then find the $m.c.m.(A, B)$ and the $m.c.d.(A, B)$.

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

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

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

Solve
Practice★★★Not started
Two comets periodically pass close to Earth. 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 periodically pass close to Earth. 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 after $p$. Comet A passes today, and it is known that the last time they coincided was $77$ years ago, which was the first time they were seen together in recorded history.

Timeline of appearances and coincidences of comets A and BComet A: period p yearsComet B: period q yearsPeriod between coincidences77 years elapsed¿? years remainingTimeLast coincidenceComets A and B77 years agoTodayComet A passesCurrent yearNext coincidenceComets A and BIn ¿? years

If $p$ and $q$ are two-digit numbers, identify which numbers they are and calculate how many years must pass before they coincide again.

Solve

How many factors does a number have?

If you know the prime factorisation of a number, you can work out how many factors it has without having to list them all.

Diagram of the calculation of the number of factors of 2³ · 3² by adding one to the indices to obtain twelve factors. N = 2³ · 3² number of factors = (3+1)·(2+1) = 4 · 3 = 12 factors
Practice★★☆Not started
Look at the following incomplete factor tree representing the prime factorisation of a natural number. Your task is to complete it and finally write down the…

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

? ? 15 2 ? 3 5 2 2
Solve
Practice★☆☆Not started
Before doing any calculations on paper, focus on the number $72$:\na) Estimate: Do you think $72$ will have more or fewer than $8$ divisors? Write down at least four…

Before doing any calculations on paper, focus on the number $72$:\na) Estimate: Do you think $72$ will have more or fewer than $8$ divisors? Write down at least four divisors that immediately come to your mind to support your initial estimate.\nb) Calculate: Find the prime factorisation of $72$ and apply the formula for the number of divisors, $(a+1)(b+1)\dots$, to find the exact quantity.\nc) Check: Compare the obtained value with your previous estimate and write a brief conclusion explaining whether your initial intuition was correct and why a number less than $100$ can have that number of divisors.

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 \times 3 \times 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 \times 3 \times 5 = 30$.

Find the largest and smallest possible "special" numbers. Next, find how many factors each of these two numbers has without needing to list them all, using only the exponents of their prime factorisations.

Solve

Back to the start: Since $\sqrt{143} \approx 11.96$, it is enough to test the primes $2, 3, 5, 7$ and $11$. When we divide $143 \div 11 = 13$, the division is exact, so $143$ is not prime ($143 = 11 \cdot 13$). Sorry, Aoife: the code needs a different number!

Summary

See all the exercises in this section