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 of this sequence 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 property 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$, and $(a_{n} + \omega^{2} a_{n-1}) + \omega (a_{n-1} + \omega^{2} a_{n-2}) = 0$. (2) From (1), we know that $\{a_{n} + \omega a_{n-1}\}$ is a geometric sequence with a common ratio of $-\omega^{2}$, i.e., $a_{n} + \omega a_{n-1} = (a_{2} + \omega a_{1})(-\omega^{2})^{n-2} = a_{2} \cdot (-\omega^{2})^{n-2} + a_{1} \omega (-\omega^{2})^{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[ (\omega^{n-2} - 1) a_{2} + (\omega^{n-2} - \omega) \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}$. This implies that for $n > 6$, $a_{n} = -a_{n-3} = a_{n-6}$, so the sequence repeats every six terms, with the sum of each cycle being zero. Therefore, $S_{1492} = 0 + a_{1} + a_{2} + (a_{2} - a_{1}) - a_{1} = 1985$, and $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[ (\omega^{n-1} - 1) \cdot 493 - (\omega^{n-1} - \omega) \cdot \omega \cdot 999 \right]$.