4. In a sequence of numbers $x_{1}, x_{2}, \cdots$, it is known that $x_{1}=1$, and for $k \geqslant 2$,
$$
x_{k}=x_{k-1}+1-4\left(\left[\frac{k-1}{4}\right]-\left[\frac{k-2}{4}\right]\right),
$$

where $[a]$ denotes the greatest integer not exceeding the real number $a$ (for example, $[2.6]=2,[0.2]=0$). Then $x_{2010}$ equals $(\quad$.
(A) 1
(B) 2
(C) 3
(D) 4
4. B.

From the given conditions, we have
$$
\begin{array}{l}
x_{1}=1, x_{2}=2, x_{3}=3, x_{4}=4, \\
x_{5}=1, x_{6}=2, x_{7}=3, x_{8}=4, \\
\cdots \cdots .
\end{array}
$$

Thus, in this sequence,
$$
x_{4 k+i}=x_{i}(k \in \mathbf{Z}, i=1,2,3,4) \text {. }
$$

Since $2010=4 \times 502+2$, we have $x_{2010}=2$.