Powered by LearningOS

Glossary

Select one of the keywords on the left…

Sequences and PatternsSequences as Functions

Reading time: ~15 min

If someone asks you for the 100th term of the sequence 3, 6, 9, 12, …, you don’t want to compute the other 99 terms first. What we really need is a rule that turns the position of a term directly into its value.

That is exactly what a function does: it assigns to every input one output. A sequence is simply a function whose domain is the positive integers:

xn = f > n

For example, the rule fn=3n gives

3, 6, 9, 12, 15, …

which is precisely our sequence. The recursive formulas and explicit formulas you have seen throughout this course are just two different ways of defining such a function.

Because sequences are functions, we can plot them. Here you can change the first term a and the difference d of an arithmetic sequence. The coloured points are the sequence terms x1,x2,…, and the line is the continuous function fx=a+x−1d:

Arithmetic

a = ${a}, d = ${d}

● sequence terms  — function fx

Geometric

a = ${b}, r = ${r}

● sequence terms  — function fx

Two important observations: the points of a sequence are always isolated – the function is only defined for whole numbers, so there is nothing between the points. And every arithmetic sequence lies on a straight line, while every geometric sequence lies on an exponential curve – the same shapes you met in the Millionaire section.

Let’s practise finding the function behind a sequence. Enter a formula for fn in each case:

Find the rule

  1. 3,7,11,15,19,…: fn =
  2. 5,10,17,26,37,…: fn =
  3. 4,12,36,108,324,…: fn =
  4. 1,3,6,10,15,…: fn =

Notice that the last one is the triangle numbers – and the second one is a sequence whose differences (5, 7, 9, 11, …) are the odd numbers. Many sequences you have met in this course can be written as combinations of the functions you already know.

Here is a final puzzle. The mysterious function machine below transforms its input n into the output fn. Four sequences went through it:

inputs: 1, 2, 3, 4, 5

outputs: 2, 4, 8, 16, 32

The output doubles every time, so the rule is fn = . But beware: knowing a few outputs is not always enough to pin down a function! The sequence 2, 4, 8, 16, 32 could also come from fn=n2−n+2 – it only starts to differ at the 6th term.

nf?

Problem Solving

1. The sequence 1, 2, 4, 8, 16, … matches fn=2n−1 and fn=n22−n2+1 for the first five terms. Find the 6th term of each function. What does this tell you about “guessing the next term” puzzles?

2. A sequence has fn=n2. What is its first difference sequence (f2−f1, f3−f2, …)? And the differences of the differences? Try the same for fn=n3 and discover a pattern.