Resources For Teachers For Tutors For Students & Parents Pricing
Year 4 Maths Patterns & Number Sequences

Algorithms that generate number sequences

20 practice questions 0 video lessons Theory + worked examples
Create a free accountTrack your progress and save your work as you go.
Create free account

Theory

An algorithm is a set of steps that makes a number sequence: it has a start number and a rule you repeat, such as add 4 each time, double each time, or a two-step rule like double then add 1. This Year 4 maths page shows how to generate a sequence, find the next or the fifth number, and work out the rule from a sequence. Curriculum: VC2M4N10 / AC9M4N09.

An algorithm is a set of steps you follow to make a number sequence. It always has two parts: a start number and a rule that you use again and again.

The start number is the first number in the sequence. The rule tells you what to do to one number to get the next number. To make the sequence, apply the rule to the last number, then keep going. For "start at 2 and add 4 each time" you get \(2,\ 6,\ 10,\ 14,\ \ldots\)

A rule can add the same amount, take away the same amount, double each number, or use a two-step rule such as "double, then add 1". Each number you make is called a term.

Algorithm arrow chain for start at 2 and add 4 each time Four boxes in a row holding 2, 6, 10 and 14. Each pair of boxes is joined by an arrow labelled plus 4, showing the rule add 4 is repeated. +4 +4 +4 2 6 10 14
An arrow chain: the rule \(+4\) is applied again and again to make each term.
A number machine that doubles the number that goes in The number 4 goes into a machine labelled double, and the number 8 comes out, because 4 doubled is 8. 4 in double out 8
A number machine uses a rule. Here the rule is double, so \(4\) goes in and \(8\) comes out.

Every algorithm for a sequence has a start number and a rule. These facts help you use and test them.

\[ \text{next term} = \text{rule applied to the last term} \]
next term=rule applied to the last term
\[ \text{in} \times 4 = \text{out} \quad \Rightarrow \quad \text{in} = \text{out} \div 4 \]
in×4=out⇒in=out÷4
Test a rule on every row. In an in and out table, a rule is only right if it works for every row. If \(3\) gives \(12\) and \(5\) gives \(20\), "add \(9\)" fits the first row but not the second, while "multiply by \(4\)" fits both.
Will a number appear? Keep applying the rule. If the sequence jumps past the number without landing on it, the number is not in the sequence.

How to make a sequence from an algorithm

  1. Write the start number. This is the first term of the sequence.
  2. Apply the rule. Do what the rule says to the last number to get the next number.
  3. Repeat. Use the same rule again and again until you have as many terms as you need.
To find the rule instead: compare each number with the one before it. Same jump up means add; a jump down means take away; each number being double the last means double each time.
Example 1 β€” Next number (add)
An algorithm says "start at 6 and add 5 each time": \(6,\ 11,\ 16,\ 21,\ \ldots\) Write the next number.
Arrow chain for start at 6 and add 5 each time with the last term unknown Boxes holding 6, 11, 16 and 21 joined by plus 5 arrows, with a final shaded box holding a question mark for the next number. +5 +5 +5 +5 6 11 16 21 ?
Solution
\(21 + 5\)\(=\)\(26\)
21+5=26

Apply the rule to the last term, so the next number is \(26\).

Example 2 β€” Name the rule
What rule makes the sequence below?
Number sequence strip showing 5, 10, 20 and 40 A strip of four number cells holding 5, 10, 20 and 40. Each number is double the one before it. 5 10 20 40
Solution
\(5 \times 2\)\(=\)\(10\)
\(10 \times 2\)\(=\)\(20\)
\(20 \times 2\)\(=\)\(40\)
20×2=40

Each number is double the one before, so the rule is double each time.

Example 3 β€” Fifth number (take away)
An algorithm starts at 40 and takes away 6 each time: \(40,\ 34,\ 28,\ \ldots\) What is the fifth number?
Solution
\(28 - 6\)\(=\)\(22\)
\(22 - 6\)\(=\)\(16\)
22-6=16

The terms are \(40,\ 34,\ 28,\ 22,\ 16\). The fifth number is \(16\).

Example 4 β€” Two-step rule
The rule is "double, then take away 1". Starting at 3: \(3,\ 5,\ 9,\ 17,\ \ldots\) Write the next number.
Solution
\(17 \times 2\)\(=\)\(34\)
\(34 - 1\)\(=\)\(33\)
(17×2)-1=33

Double first, then take away 1, so the next number is \(33\).

Example 5 β€” Rule from a table
A number machine gives these results: \(3 \to 12\), \(5 \to 20\), \(7 \to 28\). What is the rule, and what number goes in to give \(36\)?
Solution
\(3 \times 4\)\(=\)\(12\)
\(5 \times 4\)\(=\)\(20\)
\(7 \times 4\)\(=\)\(28\)
\(36 \div 4\)\(=\)\(9\)
36÷4=9

The rule multiply by 4 works for every row. To get \(36\) out, run it backwards: \(9\) goes in.

Example 6 β€” Will it appear?
An algorithm starts at \(50\) and takes away \(4\) each time. Will \(30\) be in the sequence? Will \(20\)?
Solution
\(50,\ 46,\ 42,\ 38,\ 34,\ 30\)
\(30,\ 26,\ 22,\ 18\)
50-4=46

\(30\) is the sixth number, so it appears. The sequence goes from \(22\) to \(18\), jumping over \(20\), so \(20\) does not appear.

Common pitfalls

Begin at the start number. The first term is given by the algorithm. Watch out for skipping it. In "start at 7, add 3" the sequence begins \(7,\ 10,\ 13\), not \(10,\ 13\).
Use the same rule every step. Keep doing the exact same thing each time. Watch out for changing the amount partway through the sequence.
Do two-step rules in order. For "double, then add 1" you must double first, then add 1. Swapping the order gives a different sequence.

Frequently asked questions

What is an algorithm in maths?

An algorithm is a set of steps that makes a number sequence. It has a start number and a rule you repeat, such as add 4 each time or double each time. You use the rule on the last number to get the next number.

How do you use an algorithm to make a number sequence?

Write down the start number, then apply the rule to get the next number. Keep applying the same rule again and again. For "start at 7 and add 3" you get \(7,\ 10,\ 13,\ 16\) and so on.

How do you find the next number in a sequence?

Apply the rule to the last number you have. For \(6,\ 11,\ 16,\ 21\) the rule is add 5, so the next number is \(21 + 5 = 26\).

How do you work out the rule for a number sequence?

Compare each number with the one before it. If it goes up by the same amount the rule is add that amount. If it goes down the rule is take away. If each number is double the one before, the rule is double each time.

What is a two-step rule?

A two-step rule does two things in order, such as double, then add 1. You must do the steps in the right order. Starting at 4 with double then add 1 you get \(4,\ 9,\ 19,\ 39\).

How do you find the fifth number in a sequence?

Start at the first number and apply the rule until you reach the fifth term. For "start at 40 and take away 6" you get \(40,\ 34,\ 28,\ 22,\ 16\), so the fifth number is \(16\).