If we let a n be

a n = (41/24)( n - 1)( n - 2)( n - 3)( n - 4) + 1

then we have

a 1 = 1

a 2 = 1

a 3 = 1

a 4 = 1

a 5 = 42



Therefore the next number might as well be 42. The same trick can be pulled off with any given integer sequence. In fact, it can be any number you like. This is not particularly hard to prove.

If we have been given a sequence of numbers

a 1 , a 2 , a 3 , a 4

and we wish to find the value of a 5 , then we are effectively being asked to find the the function f ( n ) such that

f (1) = a 1

f (2) = a 2

f (3) = a 3

f (4) = a 4



and then to evaluate f (5). Now, as we all know, if we are given any two points we can find a straight line through them. Given any three points we can find a parabola

f ( x ) = b 2 x 2 + b 1 x + b 0

through them. Correspondingly, given any n points on a graph, we can find a polynomial of degree n - 1:

f ( x ) = b 0 + b 1 x + ... + b n -1 x n -1

which will go through of all of them. (Well, you can't if two points are directly above each other, but this is obviously impossible in this case.) This is called Lagrange interpolation. So suppose we know

f (1) = a 1

f (2) = a 2

...

f ( n - 1) = a n -1



and we want a n to be 42. To find f ( x ), we have to solve the set of simultaneous equations;

f (1) = b 0 + b 1 + ... + b n -1 = a 1

f (2) = b 0 + 2 b 1 + ... + 2 n -1 b n -1 = a 2

...

f ( n ) = b 0 + n b 1 + ... + n n -1 b n -1 = a n = 42



We have n equations with n unknowns (being the b k ). The solution will yield a polynomial f ( x ) which satisfies our simultaneous equations and additionally has f ( n ) = a n , for any given a n . So for any integer sequence, you can arbitrarily pick your own next number and find a polynomial that proves you correct.

This is a very pedantic point to make, but you have to be a pedant to be a mathematician, because making unjustified assumptions while answering questions can be catastrophic. However, often the answer in questions like these is either fairly obvious or easy to find, so while this technique is an entertaining party trick (if one is at a particularly dull party), it's usually quicker to just find the next integer by traditional methods.