17. The integer sequence $a_{1}, a_{2}, a_{3}, \cdots$ is defined as follows: $a_{1}=1$, for $n \geqslant 1, a_{n+1}$ is the smallest integer greater than $a_{n}$, and for all $i, j, k \in\{1,2, \cdots, n+1\}$, it satisfies $a_{i}+a_{j}=3 a_{k}$. Find $a_{1998}$.
Solution: We first find the initial few $a_{n}$.
. $a_{3}=1$.
Since $1+2=3 \times 1$, then $a_{2} \neq 2 . a_{2}=3, a_{3}=4$.
Since $4+5=3+6=3 \times 3$, then $a_{4} \neq 5, a_{4} \neq 6 . a_{4}=$
7.

Since $1+8=3 \times 3,3+9=3 \times 4$, then $a_{5} \neq 8, a_{5} \neq$ 9. $u:=10$
Since $1+11=3 \times 4$, then $a_{6} \neq 11 \cdot a_{6}=12, a_{7}=13$.
Since $7+14=3 \times 7,15+15=3 \times 10$, then $a_{8} \neq 14$,
$a_{8} \neq 15 \cdot u_{8}: 16$.
By: $1.3 \div 17=3 \times 10.18+3=3 \times 7$, then $a_{9} \neq 17$, $a_{9} \neq 18 \cdot a_{9}=19$

Since $1+20=3 \times 7$, then $a_{10} \neq 20 \cdot a_{10}=21, a_{11}=$ 22 .

Since $7+23=3 \times 10,24+24=3 \times 16$, then $a_{1} \neq$ $23, a_{1} \neq 24, a_{1=}=25$. Next:
$u_{n}: 13$ 个 10 i2 131619212225
If we consider every four terms as a group, then each term in a group can be obtained by adding 9 to each term in the previous group. Below, we will verify that $a_{n}$ satisfies the following formula:
$$
\begin{array}{l}
a_{4 r+1}=9 r+1, a_{4 r+2}=9 r+3, \\
a_{4 r+3}=9 r+4, a_{4 r+4}=9 r+7,
\end{array}
$$

where $r=0,1,2, \cdots$.
When $n=0,1,2$, the conclusion holds.
Assume that for $r=0,1, \cdots, m(m \geqslant 2)$ the conclusion holds, then $a_{1}$, $a_{2}, \cdots, a_{4 m+4}$ do not have any term that is congruent to 2 modulo 3, and in the interval $[1,9 m$ $+7]$, all numbers that are congruent to 1 modulo 3 appear in the above sequence.

Since $(9 m+8)+4=3(3 m+4)$, and $3 m+4=$ $1(\bmod 3)$ is in the above sequence, so $a_{4 m+5} \neq 9 m+8$. Similarly, since $(9 m+9)+3=3(3 m+4)$, so $a_{4 m+5}$ $\neq 9 m+9$. In fact, $a_{4 m+5}=9 m+10$. Because if $(9 m+$ $10)+y=3 z$, then $y \equiv 2(\bmod 3)$, and $y$ is not in the above sequence, which is a contradiction.

Since $(9 m+11)+1=3(3 m+4)$, so $a_{4 m+6} \neq$ $9 m+11$. In fact, $a_{4 m+6}=9 m+12$. Because if $(9 m+$ $12)+y=3 z$, then $y \equiv 0(\bmod 3)$, hence $y=9 r+3$. And $(9 m$ $+12)+(9 r+3)=3(3 m+3 r+5)$, but $3 m+3 r+5$ $\equiv 2(\bmod 3)$ is not in the above sequence, which is a contradiction.

Since there is no $y \equiv 2(\bmod 3)$ in the above sequence, so $a_{4 m+7}=9 m+13$.

Since $(9 m+14)+7=3(3 m+7)$, and $3 m+7 \equiv$ $1(\bmod 3)$ is in the above sequence, so $a_{4 m+8} \neq 9 m+14$. Similarly, since $(9 m+15)+(9 m+15)=3(6 m+10)$,

and $6 m+10 \equiv 1(\bmod 3)$ is in the above sequence, so $a_{\mathrm{s} m+8}$ $\Rightarrow 9 m+15$.

Finally, since there is no $y \equiv 2(\bmod 3)$ in the above sequence, so $a_{4 m+8}=9 m+16$.
By mathematical induction, the formula for $a_{n}$ holds.
Since $1998=4 \times 499+2$, then
$a_{1 \mathrm{VMSM}}=9 \times 499+3=4494$.