21. 2.9 * Color the vertices of the $n$-sided pyramid $S-A_{1} A_{2} \cdots A_{n}$, with each vertex being a different color from its adjacent vertices on the same edge. Given $n+1$ colors to use, how many different coloring methods are there? (When $n=4$, this is a problem from the 1995 National High School Competition in China)
From $n+1$ colors, choosing 1 color to dye vertex $S$ has $\mathrm{C}_{n+1}^{1}$ methods, and the remaining $n$ colors are used to dye the $n$ vertices $A_{1}, A_{2}, \cdots, A_{n}$ on the base. Then, by problem 21.2.8, the number of methods is $a_{n}(n)$. Therefore, the total number of different methods is $\mathrm{C}_{n+1}^{1} a_{n}(n)=(n+1)\left[(n-1)^{n}+(-1)^{n}(n-1)\right]$. (When $n=4$, the number of different methods is $5\left[3^{4}+3\right]=420$ ).