-1, 2, 7, 14, 23, 34, 47, 62, 79, 98, 119, 142, 167, 194, 223, 254, 287=a(n) = n^2 - 2.
write the next term in this sequence
-1 2 7 14 23...
\(\begin{array}{lrrrrrrrrrr} & {\color{red}d_0 = -1} && 2 && 7 && 14 && 23 && \cdots \\ \text{1. Difference } && {\color{red}d_1 = 3} && 5 && 7 && 9 && 11 && \cdots \\ \text{2. Difference } &&& {\color{red}d_2 = 2} && 2 && 2 && 2 && 2 && \cdots \\ \end{array}\)
\(\begin{array}{rcl} a_n &=& \binom{n-1}{0}\cdot {\color{red}d_0 } + \binom{n-1}{1}\cdot {\color{red}d_1 } + \binom{n-1}{2}\cdot {\color{red}d_2 }\\ a_n &=& \binom{n-1}{0}\cdot ({\color{red}-1 }) + \binom{n-1}{1}\cdot {\color{red}3} + \binom{n-1}{2}\cdot {\color{red}2}\\ \\ \hline \binom{n-1}{0} &=& 1 \\ \binom{n-1}{1} &=& n-1 \\ \binom{n-1}{2} &=& ( \frac{n-1}{2} ) \cdot ( \frac{n-2}{1} ) \\ \hline \\ a_n &=& ({\color{red}-1 }) + (n-1)\cdot {\color{red}3} + ( \frac{n-1}{2} ) \cdot ( \frac{n-2}{1} )\cdot {\color{red}2}\\ a_n &=& -1 + 3n - 3 + (n-1)(n-2) \\ a_n &=& -1 + 3n - 3 + n^2-2n-n+2 \\ \mathbf{a_n} &=& \mathbf{n^2-2} \\\\ a_6 &=& 6^2-2 = 34\\ a_7 &=& 7^2-2 = 47\\ a_8 &=& 8^2-2 = 62\\ \cdots \end{array}\)