Mathster Maths topics Free worksheets Coverage Mathster for schools

Maths topics › A level Further Maths › D1 and algorithms

Follow an algorithm written in words and explain what it does

A level Further Maths · D1 and algorithms

Try a question

The box below describes an algorithm.

1 Let \(A=6\) and \(n=1\).
2 Print \(A\).
3 Let \(A=A+4 n+7\).
4 Let \(n=n+1\).
5 If \(n\le 7\), go to 2.
6 Stop.

(a) Complete the trace table to show the number printed each time step 2 is reached.

\(n\)\(A\) printed
1\(6\)
2
3
4
5
6
7

(b) What is the value of \(n\) when the algorithm stops?  

Free worksheet

10 questions on this objective, ready to print.

Download the worksheet (PDF)

We use this address to send you the answers, and for news only if you tick the box.

Worked solution

The working

  1. Print first, then change \(A\): the number printed is always the value before step 3.
  2. \(n = 1\): print \(6\). Then \(A = 6 + ((4 \times 1) + 7) = 6 + 11 = 17\) and \(n = 2\).
  3. \(n = 2\): print \(17\). Then \(A = 17 + ((4 \times 2) + 7) = 17 + 15 = 32\) and \(n = 3\).
  4. \(n = 3\): print \(32\). Then \(A = 32 + ((4 \times 3) + 7) = 32 + 19 = 51\) and \(n = 4\).
  5. \(n = 4\): print \(51\). Then \(A = 51 + ((4 \times 4) + 7) = 51 + 23 = 74\) and \(n = 5\).
  6. \(n = 5\): print \(74\). Then \(A = 74 + ((4 \times 5) + 7) = 74 + 27 = 101\) and \(n = 6\).
  7. \(n = 6\): print \(101\). Then \(A = 101 + ((4 \times 6) + 7) = 101 + 31 = 132\) and \(n = 7\).
  8. \(n = 7\): print \(132\). Then \(n\) becomes 8, which is more than 7, so the algorithm stops.
  9. Answers: (a) 17, 32, 51, 74, 101, 132; (b) \(n = 8\)

Answer: a) 17 b) 32 c) 51 d) 74 e) 101 f) 132 g) 8

Mathster is maths homework, practice and assessment for schools, with animated worked solutions. Try Mathster free for 60 days →

Objectives from the AS and A level subject content for further mathematics (Department for Education). Contains public sector information licensed under the Open Government Licence v3.0.