A number sequence puzzle is given as a finite sequence of numbers (usually, positive integers). The challenge is to find the next number in the sequence.

Or is it?

Example.


Q: 1, 2, 1, 2
A: 1
Q: Wrong, the correct answer is 56.
A: Huh?  Why?
Q: I just made it up.

From this we can see that the above definition is incomplete: the real challenge is to find the algorithm Q is using to deduce the next number in the sequence. If Q turns out not to use an algorithm at all, A will feel cheated.

But this definition is just as incomplete: if Q was allowed to use any algorithm, there would be no puzzle, for the solution would be impossible to guess. For instance, Q could justify 56 by the algorithm that generates 1, 2, 1, 2, 1, 56, 43, and then 78 to all eternity. No A would accept this as a valid solution.

So what we actually look for is a pair: the most 'natural' number in combination with the most 'natural' algorithm to generate it. This is the general problem of extrapolation of numbers.

For the purely mathematical ones, in which no 'real world knowledge' is involved, this can be done in a completely automated way: a computer program can be written to solve any number sequence puzzle.