This question already has an answer here:
- Polynomial Interpolation 3 answers
Given a set of space-delimited integers, you've gotta either return a function that can generate that sequence, or return "There isn't any such function".
Sample input:
"1 11 41 79"
- x^3+x^2-1
"12 38 78"
- 7x^2 + 5x
The operations that the functions can contain are: +-/* and exponentiation.
If anyone has any other ideas LMK. As this is a code-golf, the shortest code will win.
-2x^3+22x^2-42x+23
. The generator function you have will produce1 11 35 79
. – primo Apr 10 '13 at 15:21