For each, find the polynomial expression that gives $a_n$
1) 1, 6, 17, 34, 57, 86, 121, 162, 209, 262...
2) 4, 4, 10, 28, 64, 24, 214, 340, ...
My attempt of
1) is $3x^2+2x+1$ and
2) is $2x^2+x+4$
Im sure of 1) but cant figure 2) out. Is there any polynomial way of doing it?
Use the Lagrange interpolating polynomial. At (1) it gives you exactly the polynom you already have, but at (2) you get pretty strange polynom, check your data:
Anyway, in your case I would prefer another way to do this. Note that the distance between points is invariant: 1. So you know all $f_1(n) - f_1(n-1) = f_2(n)$. Note that $deg(f_2) < deg(f_1)$, $f_1 \in \int f_2dx$, and you have one point less to calculate $f_2$. Then if you have $f_m$, you can calculate $f_{m-1}$ - jut find the constant by this integral. So you can calculate your $f_1$ as in lazy dynprog, by calculating $f_2$, $f_3$, ... until some $f_m$ is constant (points look like (C, C, C, ..., C))
The common way for this: $$ x_i = x_0 + i\cdot h\\ x_i - x_j = (i-j) \cdot h\\ l_j(x) = \prod \limits_{i=0,i \ne j}^{n} {\frac {x - x_i} {x_j - x_i}}\\ l_j(x) = \frac {\prod \limits_{i=0,i \ne j}^{n} {(x - x_0 - i \cdot h)}} {h^{n-1} \prod \limits_{i=0,i \ne j}^{n} {(j-i)}}\\ $$ Here $L(x) = \sum \limits_{0}^{n} {y_i l_i(x)}$, where $y_i$ are your "$a_n$".