5. If the sequence $\left\{a_{n}\right\}(n \geqslant 0)$ satisfies
$$
a_{0}=0, a_{n}=a_{\left[\frac{n}{2}\right]}+\left[\frac{n}{2}\right](n \geqslant 1),
$$

then the number of positive integers $n$ such that $a_{n}=2007$ is ( ) .
(A) 0
(B) 1
(C) 2
(D) greater than 2
5.A.

By induction, we can obtain $a_{n}=n-t_{n}$, where $t_{n}$ represents the number of 1s in the binary representation of $n$.

In fact, when $n=0,1,2$, $a_{0}=0, a_{1}=0$, $a_{2}=1$, the conclusion holds true.
Assume that when $n \leqslant k-1$, $a_{n}=n-t_{n}$.
If $k=2 l$, then
$$
\begin{array}{l}
a_{k}=a_{l}+l=l-t_{l}+l=k-t_{l} \\
=k-t_{2 l}=k-t_{k} ;
\end{array}
$$

If $k=2 l+1$, then
$$
\begin{array}{l}
a_{k}=a_{l}+l=l-t_{l}+l=k-1-t_{l} \\
=k-\left(t_{2 l}+1\right)=k-t_{2 l+1}=k-t_{k} .
\end{array}
$$

If $a_{n}=2007$, then $n=2007+t_{n}$.
Since $2007=2^{10}+2^{9}+2^{8}+2^{7}+2^{6}+2^{4}+$ $2^{2}+2+1$, when $t_{n}=11$,
$$
n \geqslant 2^{10}+2^{9}+\cdots+2+1 \text {. }
$$

And $2007+t_{n}2007+t_{n}$.
For $t_{n}=1,2, \cdots, 10$, each is verified individually, and in all cases, $2007+t_{n}$ does not have $t_{n}$ number of 1s in its binary representation.

In conclusion, there does not exist a positive integer $n$ that satisfies $a_{n}=2007$.