I5.4 Given that $\left(R x^{2}-x+1\right)^{1999} \equiv a_{0}+a_{1} x+a_{2} x^{2}+\ldots+a_{3998} x^{3998}$. If $S=a_{0}+a_{1}+a_{2}+\ldots+a_{3997}$, find the value of $S$.
$$
\left(x^{2}-x+1\right)^{1999} \equiv a_{0}+a_{1} x+a_{2} x^{2}+\ldots+a_{3998} x^{3998}
$$
compare coefficients of $x^{3998}$ on both sides, $a_{3998}=1$
$$
\begin{array}{l}
\text { Put } x=1,1^{1999}=a_{0}+a_{1}+a_{2}+\ldots+a_{3998} \\
\begin{aligned}
S & =a_{0}+a_{1}+a_{2}+\ldots+a_{3997} \\
& =\left(a_{0}+a_{1}+a_{2}+\ldots+a_{3998}\right)-a_{3998} \\
& =1-1=0
\end{aligned}
\end{array}
$$