Example 5 Color each vertex of a 2003-gon with one of three colors: red, blue, or green, such that adjacent vertices have different colors. How many such colorings are there? ${ }^{[3]}$
(2002-2003, Hungarian Mathematical Olympiad)
Let $T_{n}$ be the number of ways to color each vertex of an $n$-sided polygon with one of three colors: red, blue, or green, such that no two adjacent vertices have the same color.
It is easy to see that $T_{3}=6, T_{4}=18$.
For any $n(n \geqslant 5)$, let $A_{1}, A_{2}, \cdots, A_{n}$ be the vertices of the $n$-sided polygon in sequence. Then, coloring the vertices according to the given requirements, we can divide it into two cases:
(1) $A_{1}$ and $A_{n-1}$ are different colors, with a total of $T_{n-1}$ ways;
(2) $A_{1}$ and $A_{n-1}$ are the same color, with a total of $2 T_{n-2}$ ways.
Thus, $T_{n}=T_{n-1}+2 T_{n-2}(n \geqslant 5)$.
Given $T_{3}=6, T_{4}=18$, we have:
$T_{n}=2(-1)^{n}+2^{n}$.
Therefore, $T_{2003}=2^{2003}-2$.