8. 4 people pass the ball to each other, with the requirement that each person passes the ball to someone else immediately after receiving it. Starting with person A, and counting this as the first pass, find the total number of different ways the ball can be passed such that after 10 passes, the ball is back in the hands of the starting player A.
8. Let the number of different ways the ball can return to player A after $n$ passes be $a_{n}$ (excluding the possibility of the ball returning to A before the $n$th pass), then $a_{1}=0, a_{2}=3$. Since there are $3^{n-1}$ different ways of passing the ball after $n-1$ passes. These ways can be divided into two categories:
(1) The first category is where the ball returns to A after $n-1$ passes, and there are $a_{n-1}$ such ways.
(2) The second category is where the ball is in one of the other 3 players' hands after $n-1$ passes, and the $n$th pass is to A, and there are $a_{n}$ such ways.

Thus, $a_{n}+a_{n-1}=3^{n-1}, \frac{a_{n}}{3^{n}}=\frac{-1}{3} \cdot \frac{a_{n-1}}{3^{n-1}}+\frac{1}{3}$, let $b_{n}=\frac{a_{n}}{3^{n}}$, then $b_{n}=-\frac{1}{3} b_{n-1}+\frac{1}{3}$, i.e., $b_{n}-\frac{1}{4}=-\frac{1}{3} \left(b_{n-1}-\frac{1}{4}\right)$ (here $\frac{1}{4}$ is the root of the equation $x=-\frac{1}{3} x+\frac{1}{3}$), thus $b_{n}-\frac{1}{4}=\left(b_{1}-\frac{1}{4}\right)\left(-\frac{1}{3}\right)^{n-1}=-\frac{1}{4} \left(-\frac{1}{3}\right)^{n-1}$, so $a_{n}=3^{n} b_{n}=\frac{3}{4}\left[3^{n-1}+(-1)^{n}\right]$, particularly $a_{10}=\frac{3}{4}\left(3^{9}+1\right)=14763$.