Regarding , I asserted that for x=1,2,3,4, it yields values 2, 4,6, 8, but for x=5, it yields 37. A hapless reader wrote in:
So, I am learning python, and wanted to verify your trivium. But my answer do not correspond to your assertion about the polynomial at x > 1. I am obviously doing something wrong here, and this is also a note to myself to try and find at home what that is?>>> def poly (x): ... return 9 / 8 * x * x * x * x - 45 / 4 * x * x * x + 315 / 8 * x * x - 217 / 4 * x + 27 ... >>> for x in range(10): ... print x, poly(x) ... 0 27 1 2 2 3 3 0 4 -13 5 -18 6 27 7 188 8 555 9 1242
Your job: what is the problem here?