2. Given the general term of the sequence $\left\{a_{n}\right\}$
$$
a_{n}=\frac{(n+1)^{4}+n^{4}+1}{(n+1)^{2}+n^{2}+1} \text {. }
$$

Then the sum of the first $n$ terms of the sequence $\left\{a_{n}\right\}$, $S_{n}=$ $\qquad$