Generate an explicit formula for: $a_n=a_{n-1}+n^2-5n+7, a_3=2$ So I'm currently solving this math homework problem and I've set up a recursive formula:

$a_n=a_{n-1}+n^2-5n+7; a_3=2$

Right now, I'm having trouble as to where to start. I was listing out the cases but they didn't get me very far: $a_3=2,a_4=5,a_5=12,a_6=25, \dots$
Thanks!

We may observe that:
$$
a_n-a_{n-1}=n^2-5n+7.
$$
Then we could have:
$$
\begin{align}
&a_n-a_3\\
=&\sum_{k=4}^n{a_k-a_{k-1}}\\
=&\sum_{k=4}^n{k^2-5k+7}\\
=&\left[ \left( \sum_{k=1}^n{k^2} \right) -1^2-2^2-3^2 \right] -\frac{5\left( 4+n \right) \left( n-3 \right)}{2}+7\left( n-3 \right)\\
=&\left[ \frac{n\left( n+1 \right) \left( 2n+1 \right)}{6}-14 \right] -\left( \frac{5}{2}n^2+\frac{5}{2}n-30 \right) +\left( 7n-21 \right)\\
=&\frac{1}{3}n^3-2n^2+\frac{14}{3}n-5,
\end{align}
$$
(note that the above summation has $(n-3)$ items).
So the explicit formula could be obtained by $a_n=(a_n-a_3)+a_3$:
$$
a_n=\frac{1}{3}n^3-2n^2+\frac{14}{3}n-3.
$$
