Sequences - Finding a Rule

To find a missing number in a Sequence, first we must have a Rule

Sequence

A Sequence is a set of things (usually numbers) that are in order.

Sequence 3, 5, 7, 9, 11 labeled as 1st, 2nd, 3rd, 4th, and 5th terms

Each number in the sequence is called a term (or sometimes "element" or "member"), read Sequences and Series for a more in-depth discussion.

Finding Missing Numbers

To find a missing number, first find a Rule behind the Sequence.

Sometimes we can just look at the numbers and see a pattern:

Example: 1, 4, 9, 16, ?

Answer: they are Squares (12=1, 22=4, 32=9, 42=16, ...)

Rule: xn = n2

Sequence: 1, 4, 9, 16, 25, 36, 49, ...

We write rules using n for the term position and xn for the term value:

xn means "term number n"

We can use that rule to find any term directly by plugging in n.

For example, to find term 3 (written x3):

x3 = 32 = 9

For term 25:

x25 = 252 = 625

Using Previous Terms

Some rules don't use n directly, instead they use previous terms:

Example: 3, 5, 8, 13, 21, ... ?

After 3 and 5 the rest are the sum of the two numbers before (3 + 5 = 8, 5 + 8 = 13, and so on).

This is part of the Fibonacci Sequence:

3, 5, 8, 13, 21, 34, 55, 89, ...

Which has this Rule:

Rule: xn = xn-1 + xn-2

Note: This kind of rule needs the first two terms to get started (in this case 3 and 5).

What does xn-1 and xn-2 mean?

  • xn is the current term
  • xn-1 is the previous term (1 step back)
  • xn-2 is the term before that (2 steps back)

Let's try that Rule for the 6th term:

x6 = x6-1 + x6-2

x6 = x5 + x4

So term 6 equals term 5 plus term 4. We already know term 5 is 21 and term 4 is 13, so:

x6 = 21 + 13 = 34

So we have Two Types of Rules:

  • Explicit: lets us calculate any term directly from n (like xn = n2)
  • Recursive (or Term-to-Term): uses previous terms to find the next term (like xn = xn-1 + xn-2)

Many Rules

One of the troubles with finding "the next number" in a sequence is that mathematics is so powerful we can find more than one Rule that works.

What's the next number in the sequence 1, 2, 4, 7, ?

Here are three solutions (there can be more!):


Solution 1: Add 1, then add 2, 3, 4, ...

So, 1+1=2, 2+2=4, 4+3=7, 7+4=11, and so on...

Rule: xn = n(n-1)/2 + 1

Sequence: 1, 2, 4, 7, 11, 16, 22, ...

(That rule looks a bit complicated, but it works)

Solution 2: After 1 and 2, add the two previous numbers, plus 1:

Rule: xn = xn-1 + xn-2 + 1

Sequence: 1, 2, 4, 7, 12, 20, 33, ...

Solution 3: After 1, 2 and 4, add the three previous numbers

Rule: xn = xn-1 + xn-2 + xn-3

Sequence: 1, 2, 4, 7, 13, 24, 44, ...

So, we have three perfectly reasonable solutions, and they create totally different sequences.

Which is right? They are all right.

And there are other solutions ...

Race car displaying number 7

... it may be a list of the winners' numbers ... so the next number could be ... anything!

Simplest Rule

To choose a rule confidently, we usually need more terms or some real-world context (what the numbers mean).

When in doubt choose the simplest rule that makes sense, but also mention that there are other solutions.

Finding Differences

Sometimes it helps to find the differences between each pair of numbers ... this can often reveal an underlying pattern.

Here's a simple case:

Sequence 7, 9, 11, 13, 15 with constant first difference of plus 2

The differences are always 2, so we can guess that "2n" is part of the answer.

Let's try 2n:

n: 1 2 3 4 5
Terms (xn): 7 9 11 13 15
2n: 2 4 6 8 10
Wrong by: 5 5 5 5 5

The last row shows that we are always wrong by 5, so just add 5 and we are done:

Rule: xn = 2n + 5

OK, we could have worked out "2n+5" by just playing around with the numbers a bit, but we want a systematic way to do it, for when the sequences get more complicated.

Second Differences

In the sequence {1, 2, 4, 7, 11, 16, 22, ...} we need to find the differences ...

... and then find the differences of those (called second differences), like this:

Sequence 1 to 16 showing first differences 1, 2, 3, 4, 5 and constant second difference of 1

When the second differences are constant, the rule involves n2, and also half of the second difference.

In our case the second difference is 1, so let's try n22 :

n: 1 2 3 4 5
Terms (xn): 1 2 4 7 11
           
n22 0.5 2 4.5 8 12.5
Wrong by: 0.5 0 -0.5 -1 -1.5

We are close, but seem to be drifting by 0.5, so let's try: n22n2

n22n2
0 1 3 6 10
Wrong by: 1 1 1 1 1

Wrong by 1 now, so let's add 1:

n22n2 + 1
1 2 4 7 11
Wrong by: 0 0 0 0 0

We did it!

The formula n22n2 + 1 can be simplified to n(n-1)/2 + 1

So by "trial-and-error" we discovered a rule that works:

Rule: xn = n(n-1)/2 + 1

Sequence: 1, 2, 4, 7, 11, 16, 22, 29, 37, ...

Other Types of Sequences

Read Sequences and Series to learn about:

And there are also:

And many more!

Visit the On-Line Encyclopedia of Integer Sequences to be amazed.

If there's a special sequence you would like covered here let me know.

598, 3897, 3898, 1245, 599, 3013, 3899, 3014, 1246, 3900