This is what I would do:
N)0 as the next numberN-order polynomial that goes through all the integersSo for your example of
2 4 8 ?
The answer is
2 4 8 0
Which is clearly a logical relation, since it follows this equation perfectly:
(-7/3.)*i**3 + 8*i**2 + (-11/3.)*i + 2
Where i is in the index in the sequence. I found this with python/numpy:
x = array([0, 1, 2, 3])
y = array([2, 4, 8, 0])
polyfit(x, y, deg=3)
They might say this is not a real relation and ask for more numbers, so you might want to play it safe and use N+10 with all zeros. So:
-0.000700 * i**9 +
0.030010 * i**8 +
-0.545073 * i**7 +
5.452083 * i**6 +
-32.632755 * i**5 +
118.526042 * i**4 +
-251.163536 * i**3 +
275.991865 * i**2 +
-113.657937 * i +
2.000000
2 4 8 0 0 0 0 0 0 0
Advantages of this approach: