9. (2004 Shanghai High School Competition Problem) The sequence $\left\{a_{n}\right\}$ satisfies $(n-1) a_{n+1}=(n+1) a_{n}-2(n-1), n=$ $1,2, \cdots$ and $a_{100}=10098$. Find the general term formula of the sequence $\left\{a_{n}\right\}$.
9. Given the recurrence relation can be transformed into $\frac{a_{n+1}}{(n+1) n}=\frac{a_{n}}{n(n-1)}-\frac{2}{(n+1) n}$, i.e., $\frac{a_{n+1}}{(n+1) n}-\frac{a_{n}}{n(n-1)}=\frac{2}{n+1}-\frac{2}{n}$. Therefore, $\frac{a_{n}}{n(n-1)}-\frac{a_{2}}{2 \cdot 1}=\sum_{k=2}^{n-1}\left(\frac{a_{k+1}}{(k+1) k}-\frac{a_{k}}{k(k-1)}\right)=\sum_{k=2}^{n-1}\left(\frac{2}{k+1}-\frac{2}{k}\right)=\frac{2}{n}-\frac{2}{2}$, i.e., $a_{n}=2(n-1)+\frac{n(n-1)}{2}$. $\left(a_{2}-2\right)=(n-1)\left(\frac{n}{2} a_{2}-n+2\right)$. Also, $a_{100}=10098$, so $10098=99\left(50 a_{2}-100+2\right)$, solving for $a_{2}$ gives $a_{2}=4$, hence $a_{n}=(n-1)(n+2)(n \geqslant 3)$. Substituting $n=1$ into the known equation yields $a_{1}=0$. Also, $a_{2}=4$, so $a_{n}=(n-1)(n+2)$ holds for all $n \in \mathbf{N}_{+}$.