Everything2
Near Matches
Ignore Exact
Full Text
Everything2

How to find the nth term of a number sequence

created by Noung

(idea) by Noung (27 s) (print)   ?   1 C! I like it! 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 (20.8 hr) (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".


printable version
chaos

How to solve any number sequence puzzle Math is a social construct Lagrange interpolation Math is not a social construct
formulae is the plural of formula Limitations on Artificial Intelligence Aronson's Sequence 2n+3
Fibonacci mathematics ith The math Project
Mathematica Perrin numbers Wang Probability puzzles
Shannon's Expansion Anal sex Fuck the System 31337
fine motor skills Periodic Table of the Elements prime arithmetic sequence
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.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
Things you could have written:
True neutral
Nigerian mail scams
It's always a good idea to tell people you love them if you do
Simone Weil
Fragments
pad thai
ER
social loafing
I gave her two daisies. This is how I met your mother.
Second Punic War
The good drug guide
Space Ghost Coast to Coast
aburage
New Writeups
cryforhelp
Major dictionaries of the world(review)
Glowing Fish
The Uncanny X-Men and the New Teen Titans(thing)
WolfKeeper
Launch loop(idea)
TendoKing
Katana(person)
Wuukiee
Highly ornamental cultivars of brambles still have as many thorns as their wild counterparts(idea)
TheDeadGuy
Editor Log: May 2008(log)
everyday j.Lo
pray do not molest them(thing)
ammie
Bands Who Take Their Names from Eighteenth-century English Poetry and Prose(idea)
shaogo
Under My Thumb(review)
ammie
Rock On(person)
The Custodian
The Dresden Files(thing)
Ouzo
PETA becomes you, a proposed future(fiction)
Ereneta
Stone Soup, Part Two(fiction)
jjen
Sorrier than I ever thought I would be(personal)
locke baron
Moskva class antisubmarine cruiser(thing)
Everything 2 is brought to you by the letter C and The Everything Development Company