Example 2. Given $a_{1}=7, a_{\mathrm{n}}=a_{\mathrm{n}-1}+3 n+1$, find $a_{n}$.

 untranslated text:
例2. 已知 $a_{1}=7, a_{\mathrm{n}}=a_{\mathrm{n}-1}+3 n+1$,求 $a_{n}$.

 translated text:
Example 2. Given $a_{1}=7, a_{\mathrm{n}}=a_{\mathrm{n}-1}+3 n+1$, find $a_{n}$.
Solve $k=1, a_{\mathrm{k}}=a_{1}=7, b=3, c=1$.
From equation (5), we have
$$
\begin{aligned}
a_{\mathrm{n}} & =7+\left(\frac{1+1+n}{2} \times 3+1\right)(n-1) \\
& =\frac{3}{2} n^{2} + \frac{5}{2} n + 2 .
\end{aligned}
$$

Three, given $a_{\mathrm{k}}$, and $a_{\mathrm{n}}=b a_{\mathrm{n}-1}+c$, find $a_{\mathrm{n}}$ (where $b, c$ are constants).
$a_{n-1}$ and $a_{n}$ have a linear relationship. In a geometric sequence, there is $q=\frac{r}{a_{n-1}}$. We can create a sequence $\left\{A_{\mathrm{n}}\right\}$, such that $A_{\mathrm{n}}$ is related to $a_{\mathrm{n}}$; and $q=\frac{A_{\mathrm{n}}}{A_{\mathrm{n}-1}}$.
Let $A_{\mathrm{n}}=a_{\mathrm{n}}+k$,

then $q=\frac{A_{n}}{A_{n-1}}=\frac{a_{n}+k}{a_{n-1}+k}$,
i.e., $a_{n}=q a_{a-1}+(q-1) k$.
Since $a_{\mathrm{n}}=b a_{n-1}+c$, when $b \neq 1$, we have
$$
q=b, \quad k=\frac{c}{b-1} .
$$

Thus, we can find a sequence $\left\{A_{\mathrm{n}}\right\}$, whose general term is $A_{\mathrm{I}}=a_{\mathrm{I}}+\frac{c}{b-1}$, with a common ratio of $b$ in the geometric sequence, then
$$
\begin{aligned}
\prod_{\mathrm{i}=\mathrm{k}+1}^{\mathrm{n}} \frac{A_{1}}{A_{1-1}} & =\underset{\mathrm{n}-\mathrm{k} \uparrow}{q q \cdots q} . \\
& =q^{\mathrm{n}-\mathrm{k}}=b^{\mathrm{n}-\mathrm{k}} .
\end{aligned}
$$

Notice that
$$
\prod_{\mathfrak{k}-\mathrm{k}+1}^{n} \frac{A_{1}}{A_{1-1}}=\frac{A_{\mathrm{n}}}{A_{\mathrm{k}}}=\frac{a_{\mathrm{n}}+\frac{c}{b-1}}{a_{\mathrm{k}}+\frac{c}{b-1}} .
$$

From (8) and (9), we get the general term as
$$
a_{\mathrm{n}}=b^{\mathrm{n}-\mathrm{k}}\left(a_{\mathrm{k}}+\frac{c}{b-1}\right)-\frac{c}{b-1} \text {. }
$$

When $b=1$, then $\left\{a_{\mathrm{n}}\right\}$ is an arithmetic sequence with a common difference of $c$, so we have
$$
a_{n}=a_{\mathbf{k}}+(n-k) c .
$$