4. Define the sequence $(a_n)$ by
$$
a_n=n+\{\sqrt{n}\},
$$
where $n$ is a positive integer and $\{x\}$ denotes the nearest integer to $x$, where halves are rounded up if necessary. Determine the smallest integer $k$ for which the terms $a_k,a_{k+1},\ldots,a_{k+2000}$ form a sequence of $2001$ consecutive integers.