21. (CAN) Let $a_{0}, a_{1}, a_{2}, \ldots$ be an increasing sequence of nonnegative integers such that every nonnegative integer can be expressed uniquely in the form $a_{i}+2 a_{j}+4 a_{k}$, where $i, j, k$ are not necessarily distinct. Determine $a_{1998}$.
21. Such a sequence is obviously strictly increasing. We note that it must be unique. Indeed, given $a_{0,}, a_{1}, \ldots, a_{n-1}$, then $a_{n}$ is the least positive integer not of the form $a_{i}+2 a_{j}+4 a_{k,} i, j, k<n$.
We easily get that the first few $a_{n}$ 's are $0,1,8,9,64,65,72,73, \ldots$. Let $\left\{c_{n}\right\}$ be the increasing sequence of all positive integers that consist of zeros and ones in base 8 , i.e., those of the form $t_{0}+2^{3} t_{1}+\cdots+2^{3} t_{q}$ where $t_{i} \in\{0,1\}$. We claim that $a_{n}=c_{n}$. To prove this, it is enough to show that each $m \in \mathbb{N}$ can be uniquely written as $c_{i}+2 c_{j}+4 c_{\lambda}$. If $m=t_{0}+2 t_{1}+\cdots+2^{r} t_{r}\left(t_{i} \in\{0,1\}\right)$, then $m=c_{i}+2 c_{j}+2^{2} c_{k}$ is obviously possible if and only if $c_{4}=t_{0}+2^{3} t_{3}+2^{6} t_{6}+\cdots, c_{9}=t_{1}+2^{3} t_{4}+\ldots$, and $c_{k}=t_{2}+2^{3} t_{5}+\cdots$.
Hence for $n=s_{0}+2 s_{1}+\cdots+2^{r} s_{r}$ we have $a_{n}=s_{0}+8 s_{1}+\cdots+8^{r} s_{r}$. In particular, $1998=2+2^{2}+2^{3}+2^{6}+2^{7}+2^{8}+2^{9}+2^{10}$, so $a_{1995}=$ $8+8^{2}+8^{3}+8^{6}+8^{7}+8^{8}+8^{9}+8^{10}=1227096648$.
Second solution. Define $f(x)=x^{a_{0}}+x^{a_{1}}+\cdots$. Then the assumed property of $\left\{a_{n}\right\}$ gives
$$
f(x) f\left(x^{2}\right) f\left(x^{4}\right)=\sum_{i, j, k} x^{a_{i}+2 x j+4 x_{k}}=\sum_{n} x^{n}=\frac{1}{1-x} .
$$

We also get as a consequence $f\left(x^{2}\right) f\left(x^{4}\right) f\left(x^{8}\right)=\frac{1}{1-x^{2}}$, which gives $f(x)=$ $(1+x) f\left(x^{8}\right)$. Continuing this, we obtain
$$
f(x)=(1+x)\left(1+x^{8}\right)\left(1+x^{8^{2}}\right) \cdots .
$$

Hence the $\alpha_{n}$ 's are integers that have only 0's and 1's in base 8 .