3 Theorem Application Example
Question Given the sequence $\left\{a_{n}\right\}$ satisfies:
$$
a_{1}=a_{2}=a_{3}=1, a_{4}=-1, a_{5}=0 \text {, }
$$

and for any $n \in \mathbf{Z}_{+}$, we have
$$
a_{n+5}=3 a_{n+4}-4 a_{n+3}+4 a_{n+2}-3 a_{n+1}+a_{n} \text {. }
$$

Find the general term formula for the sequence $\left\{a_{n}\right\}$.
This is a fifth-order linear recurrence sequence, and the corresponding characteristic equation is
$$
x^{5}-3 x^{4}+4 x^{3}-4 x^{2}+3 x-1=0.
$$

The five roots can be found to be $i$, $-i$, $1$, $1$, $1$, where $1$ is a triple root.
By theorem, we can assume
$$
a_{n}=C_{1} i^{n}+C_{2}(-\mathrm{i})^{n}+\left(C_{3} n^{2}+C_{4} n+C_{5}\right) \times 1^{n},
$$

where $C_{i}(i=1,2, \cdots, 5)$ are undetermined coefficients. Then
$$
\begin{array}{l}
a_{1}=C_{1} 1^{1}+C_{2}(-\mathrm{i})^{1}+\left(C_{3} \times 1^{2}+C_{4} \times 1+C_{5}\right) \times 1=1, \\
a_{2}=C_{1} i^{2}+C_{2}(-\mathrm{i})^{2}+\left(C_{3} \times 2^{2}+C_{4} \times 2+C_{5}\right) \times 1^{2}=1, \\
a_{3}=C_{1} i^{3}+C_{2}(-\mathrm{i})^{3}+\left(C_{3} \times 3^{2}+C_{4} \times 3+C_{5}\right) \times 1^{3}=1, \\
a_{4}=C_{1} 1^{4}+C_{2}(-\mathrm{i})^{4}+\left(C_{3} \times 4^{2}+C_{4} \times 4+C_{5}\right) \times 1^{4}=-1, \\
a_{5}=C_{1} 1^{5}+C_{2}(-\mathrm{i})^{5}+\left(C_{3} \times 5^{2}+C_{4} \times 5+C_{5}\right) \times 1^{5}=0 .
\end{array}
$$

Solving the above system of equations, we get
$$
\begin{array}{l}
C_{1}=\frac{-3+7 \mathrm{i}}{8}, C_{2}=\frac{-3-7 \mathrm{i}}{8}, \\
C_{3}=\frac{3}{4}, C_{4}=-\frac{19}{4}, C_{5}=\frac{27}{4} .
\end{array}
$$

Therefore, the general term formula for the sequence $\left\{a_{n}\right\}$ is
$$
\begin{aligned}
a_{n}= & \frac{-3+7 \mathrm{i}}{8} \mathrm{i}^{n}+\frac{-3-7 \mathrm{i}}{8}(-\mathrm{i})^{n}+ \\
& \frac{3 n^{2}-19 n+27}{4} .
\end{aligned}
$$