How to find the nth term of a number sequence

created by Noung
(idea) by Noung (1.6 hr) (print)   ?   (I like it!) 1 C! Sun Apr 22 2001 at 16:55:12
The nth term of a number sequence is a formula that gives you the number at position n in that sequence. There are two different formulae for calculating the nth term, and which one you use depends on the sequence.

The common difference formula

Imagine the sequence: 2, 4, 6, 8, 10, ... - We want to work out the nth term for this sequence. The formula used here is

dn + ( a - d )

Where -
d = Common difference between all terms.
a = First term.

An example of its use on this sequence -

dn + ( a - d )
2n + ( 2 - 2 )

nth term = 2n

Proof, by finding the third term -

2n
2 * 3

= 6

Changing difference formula

This is a bit more complicated, and is applied to sequences where the difference between each number is not a constant, as in the sequence: 3, 5, 9, 15, 24, ... The trick here is to find the difference increase - so, the difference between 3 and 5 is 2, the difference between 5 and 9 is 4, the difference between 9 and 15 is 6... see the pattern emerging? The difference increase is 2. So, we use the formula -

a + (n-1)d + 0.5(n-1)(n-2)C

Where -
d = the first difference (2 in the sequence above).
C = The difference increase.
a = the first term.

So, an example of its use, using the sequence above -

a + (n-1)d + 0.5(n-1)(n-2)C
3 + (n-1)2 + 0.5(n-1)(n-2)2
3 + 2n - 2 + n2 - 2n - n + 2> 3 + n2 - n

Proof, by finding the 4th term:

3 + n2 - n
3 + 16 - 4

= 15.

(idea) by rp (3.9 wk) (print)   ?   (I like it!) Mon Apr 23 2001 at 13:37:50
This idea can be generalized.

Noung's writeup will allow you to solve any number sequence puzzle where the numbers are on a straight line (a first-order polynomial) or a parabola (a second-order polynomial), respectively.

Using Lagrange interpolation, any number sequence puzzle can be solved by fitting a polynomial of degree n-1 through the n numbers given. You can even prove your solution correct!

However, a polynomial may not always be the best fit - for instance, for the number sequence 1, 2, 1, 2, 1 the 'obvious' next number is 2, but the underlying function that alternates between 1 and 2 is not a polynomial, and Lagrange interpolation will produce a different result. This can be solved by using an even more general method of interpolation that allows arbitrary functions to be fit onto the given points. But it seems more appropriate to discuss this under the more descriptive title "How to solve any number sequence puzzle".

Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.