5. Select a sequence of integers $a_{1}, a_{2}, a_{3}, \cdots$, such that for each $n \geqslant 3$, there is $a_{n}=a_{n-1}-a_{n-2}$. If the sum of the first 1492 terms is 1985, and the sum of the first 1985 terms is 1492, find the general term of the sequence.
5. For $n \geqslant 3$, we have $a_{n}=a_{n-1}-a_{n-2}$. Using the properties of the non-real cube root of unity $\omega$, we get $a_{n}+(\omega + \omega^{2}) a_{n-1} + \omega^{3} a_{n-2} = 0$. Thus, $a_{n} + \omega a_{n-1} + \omega^{2} \cdot (a_{n-1} + \omega a_{n-2}) = 0$, (1) $\left(a_{n} + \omega^{2} a_{n-1}\right) + \omega \left(a_{n-1} + \omega^{2} a_{n-2}\right) = 0$, (2) From (1), we know that $\left\{a_{n} + \omega a_{n-1}\right\}$ is a geometric sequence with common ratio $-\omega^{2}$, i.e., $a_{n} + \omega a_{n-1} = \left(a_{2} + \omega a_{1}\right) \left(-\omega^{2}\right)^{n-2} = a_{2} \left(-\omega^{2}\right)^{n-2} + a_{1} \omega \left(-\omega^{2}\right)^{n-2}$.
Similarly, from (2) we have $a_{n} + \omega^{2} a_{n-1} = a_{2} (-\omega)^{n-2} + a_{1} \omega^{2} (-\omega)^{n-2}$. (4)
Subtracting (4) from (3) gives $a_{n-1} = \frac{(-\omega)^{n-2}}{\omega - \omega^{2}} \left[\left(\omega^{n-2} - 1\right) a_{2} + \left(\omega^{n-2} - \omega\right) \omega a_{1}\right]$. (5) Also, for $n \geqslant 3$, $a_{n} = a_{n-1} - a_{n-2} = (a_{n-2} - a_{n-3}) - a_{n-2} = a_{n-3}$. Therefore, for $n > 6$, $a_{n} = -a_{n-3} = a_{n-6}$, meaning the sequence repeats every six terms, with the first six terms being $a_{1}, a_{2}, a_{2} - a_{1}, -a_{1}, -a_{2}, a_{1} - a_{2}$, and the sum of each cycle of six terms is zero. Thus, $S_{1492} = 0 + a_{1} + a_{2} + (a_{2} - a_{1}) - a_{1} = 1985$, $S_{1998} = 0 + a_{1} + a_{2} + (a_{2} - a_{1}) - a_{1} - a_{2} = 1492$, which gives $a_{1} = -999$, $a_{2} = 493$. Substituting $a_{1}$ and $a_{2}$ into (5) yields the general term formula, $a_{n} = \frac{(-\omega)^{n-1}}{\omega - \omega^{2}} \left[\left(\omega^{n-1} - 1\right) \cdot 493 - \left(\omega^{n-1} - \omega\right) \cdot \omega \cdot 999\right]$.