9. Let the sequence $\left\{a_{n}\right\}$ have the sum of its first $n$ terms denoted by $S_{n}$. The sequence of these sums satisfies $S_{n}+S_{n+1}+S_{n+2}=6 n^{2}+9 n+7$ $(n \geqslant 1)$. Given that $a_{1}=1, a_{2}=5$, find the general term formula for the sequence $\left\{a_{n}\right\}$.
Let $S_{n}=a n^{2}+b n+c$, then $S_{n+1}=a(n+1)^{2}+b(n+1)+c, S_{n+2}=a(n+2)^{2}+b(n+2)+c$.
Thus, $S_{n}+S_{n+1}+S_{n+2}=3 a n^{2}+(6 a+3 b) n+(5 a+3 b+3 c)=6 n^{2}+9 n+7$
$$
\Rightarrow\left\{\begin{array} { l } 
{ 3 a = 6 , } \\
{ 6 a + 3 b = 9 , } \\
{ 5 a + 3 b + 3 c = 7 }
\end{array} \Rightarrow \left\{\begin{array}{l}
a=2, \\
b=-1, \\
c=0
\end{array} \Rightarrow S_{n}=2 n^{2}-n .\right.\right.
$$

Upon verification, $S_{1}=1=a_{1}, S_{2}=6=a_{1}+a_{2}$ hold.
For $n \geqslant 2$, $a_{n}=S_{n}-S_{n-1}=4 n-3$, and this formula also holds for $n=1$.
Therefore, the general term formula of the sequence $\left\{a_{n}\right\}$ is $a_{n}=4 n-3\left(n \in \mathbf{N}^{*}\right)$.