## Find the next number puzzles

For the discussion of math. Duh.

Moderators: gmalivuk, Moderators General, Prelates

### Find the next number puzzles

For problems such as "what's the next number in the sequence: ...", I know it is possible to create an nth degree polynomial that satisfies all points. Does anyone have more information on this, or how to go about creating the polynomial?
mchainmail

Posts: 10
Joined: Fri Jul 03, 2009 3:21 am UTC

### Re: Find the next number puzzles

mchainmail wrote:For problems such as "what's the next number in the sequence: ...", I know it is possible to create an nth degree polynomial that satisfies all points. Does anyone have more information on this, or how to go about creating the polynomial?

This should have what you’re looking for. There’s a brief discussion of the matter on Wikipedia as well.
Small Government Liberal

Qaanol

Posts: 2395
Joined: Sat May 09, 2009 11:55 pm UTC

### Re: Find the next number puzzles

That wikipedia page is a little light on describing or even linking to the most practical method for generating the interpolation polynomial, so here's another link to the Lagrange technique.
Tirian

Posts: 1557
Joined: Fri Feb 15, 2008 6:03 pm UTC

### Re: Find the next number puzzles

Also, if you’re looking at that type of “puzzle”, you’ll probably want the next entry to be an integer. You can either just pick an arbitrary value of your choice and find the polynomial interpolating that, or you can leave that y as a variable to come up with a general expression.
Small Government Liberal

Qaanol

Posts: 2395
Joined: Sat May 09, 2009 11:55 pm UTC

### algorithm for calculating first coefficient

I don't know how to figure out the remaining coefficients of the interpolating polynomial, but here is a (sort of) easy way to find the first coefficient. Let the function f(x1,y1,x2,y2,...) evaluate the first coefficient of the interpolating polynomial between said points (this may seem circular, but recursion is needed to calculate this for more than two points). For two points this is easy f(x1,y1,x2,y2)=(y2-y1)/(x2-x1), now for the recursion bit, f(x1,y1,x2,y2,...,xn-1,yn-1,xn,yn)=(f(x2,y2,x3,y3,...,xn,yn)-f(x1,y1,x2,y2,...xn-1,yn-1))/(xn-x1)
tomtom2357

Posts: 555
Joined: Tue Jul 27, 2010 8:48 am UTC