(solved by Thomas Williams). Let $\lambda$ be the positive root of the equation $t^{2}-1998 t-1=0$. Let the sequence $\left(x_{n}\right)$ be defined by $x_{0}=1$ and, for all $n \geqslant 0$, by:

$$
x_{n+1}=\left[\lambda x_{n}\right]
$$

where $[x]$ is the integer part of $x$. Calculate the remainder of the Euclidean division of $x_{1998}$ by 1998.
. On a

$$
1998<\lambda=\frac{1998+\sqrt{1998^{2}+4}}{2}=999+\sqrt{999^{2}+1}<1999
$$

so $x_{1}=1998$. Since $\lambda^{2}-1998 \lambda-1=0$, we have $\lambda=1998+\frac{1}{\lambda}$ and $x \lambda=1998 x+\frac{x}{\lambda}$ for any real number $x$. Furthermore, $\lambda$ is irrational and $x_{n-1}$ is an integer, so $\lambda x_{n-1}$ is not an integer; thus, since $x_{n}=\left[\lambda x_{n-1}\right]$, we have $x_{n}<\lambda x_{n-1}<x_{n}+1$, or equivalently,

$$
\frac{x_{n}}{\lambda}<x_{n-1}<\frac{x_{n}+1}{\lambda}
$$

which we rewrite as

$$
x_{n-1}-1<x_{n-1}-\frac{1}{\lambda}<\frac{x_{n}}{\lambda}<x_{n-1}
$$

and we deduce that $\left[x_{n} / \lambda\right]=x_{n-1}-1$. Since $1998 x_{n}$ is an integer, we have

$$
x_{n+1}=\left[x_{n} \lambda\right]=\left[1998 x_{n}+\frac{x_{n}}{\lambda}\right]=1998 x_{n}+x_{n-1}-1
$$

and in particular $x_{n+1} \equiv x_{n-1}-1(\bmod 1998)$. By induction, $x_{1998} \equiv x_{0}-999 \equiv 1000(\bmod 1998)$.