9. Let the sequence $\left\{a_{n}\right\}$ have the sum of the 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 $a_{n}$.

Let the sequence $\left\{a_{n}\right\}$ have the sum of the 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 $a_{n}$.
Solution one: First, $S_{1}=1, S_{2}=6, S_{3}=6+a_{3}$, and $S_{1}+S_{2}+S_{3}=22$ implies $a_{3}=9, S_{3}=15$. Similarly, we can get $a_{4}=13$.

Still using the recursive formula for $S_{n}$, we have $S_{n+1}+S_{n+2}+S_{n+3}=6 n^{2}+21 n+22$, so $a_{n+1}+a_{n+2}+$ $a_{n+3}=S_{n+3}-S_{n}=12 n+15$, that is
$$
a_{n}+a_{n+1}+a_{n+2}=12 n+3, n \geqslant 2 .
$$

Subtracting this from $a_{n+1}+a_{n+2}+a_{n+3}=12 n+15$, we get $a_{n+3}-a_{n}=12$. This indicates that $a_{3 k-1}, a_{3 k}$ and $a_{3 k+1}$ are arithmetic sequences with a common difference of 12, their first terms being $a_{2}=5, a_{3}=9$ and $a_{4}=13$.

Noting that $a_{1}, a_{2}, a_{3}, a_{4}$ form an arithmetic sequence with a common difference of 4. Therefore, $a_{n}$ is also an arithmetic sequence with a common difference of 4, and the general term formula is $a_{n}=4 n-3(n \geqslant 1)$.

Solution two: Similarly, we can get $a_{3}=9, a_{4}=13, \ldots$, so we can guess that the general term formula for $a_{n}$ is $a_{n}=4 n-3$, and then prove this formula by induction.

Clearly, the formula holds for $n=1,2$. Assuming the formula holds for $n \leqslant k,(k \geqslant 2)$, then when $n \leqslant k$, we have $S_{n}=2 n(n+1)-3 n=2 n^{2}-n$. According to the recursive formula, we have
$$
\begin{aligned}
a_{k+1} & =S_{k+1}-S_{k}=\left(S_{k+1}+S_{k}+S_{k-1}\right)-2 S_{k}-S_{k-1} \\
& =6(k-1)^{2}+9(k-1)+7-4 k^{2}+2 k-2(k-1)^{2}+k-1 \\
& =4 k+1=4(k+1)-3
\end{aligned}
$$

Thus, we have completed the proof.