First, check to see if the formula has constant differences at some level. The sequence of first differences is \(4, 7, 10, \ldots\) which is arithmetic, so the sequence of second differences is constant. The sequence is \(\Delta^2\)-constant, so the formula for \(a_n\) will be a degree 2 polynomial. That is, we know that for some constants \(a\text{,}\) \(b\text{,}\) and \(c\text{,}\)

\begin{equation*} a_n = an^2 + bn + c\text{.} \end{equation*}

Now to find \(a\text{,}\) \(b\text{,}\) and \(c\text{.}\) First, it would be nice to know what \(a_0\) is, since plugging in \(n = 0\) simplifies the above formula greatly. In this case, \(a_0 = 2\) (work backwards from the sequence of constant differences). Thus

\begin{equation*} a_0 = 2 = a\cdot 0^2 + b \cdot 0 + c\text{,} \end{equation*}

so \(c = 2\text{.}\) Now plug in \(n =1\) and \(n = 2\text{.}\) We get

\begin{equation*} a_1 = 3 = a + b + 2 \end{equation*}
\begin{equation*} a_2 = 7 = a4 + b 2 + 2\text{.} \end{equation*}

At this point we have two (linear) equations and two unknowns, so we can solve the system for \(a\) and \(b\) (using substitution or elimination or even matrices). We find \(a = \frac{3}{2}\) and \(b = \frac{-1}{2}\text{,}\) so \(a_n = \frac{3}{2} n^2 - \frac{1}{2}n + 2\text{.}\)