21. (2003 British Mathematical Olympiad, adapted) Let $f$ be a function from the set of non-negative integers to itself, for all $n \geqslant 0$. It satisfies:
(1) $[f(2 n+1)]^{2}-[f(2 n)]^{2}=6 f(n)+1$;
(2) $f(2 n) \geqslant f(n)$.
How many numbers in the range of $f$ are less than 2008?
21. In condition (1), let $n=0$, we get
$$
f^{2}(1)-f^{2}(0)=6 f(0)+1 .
$$

That is, $f^{\prime}(1)=[f(0)+3]^{2}-8$. Therefore, we have $[f(0)+3+f(1)][f(0)+3-f(1)]=8=4 \times 2$.
Since the difference between $f(0)+3+f(1)$ and $f(0)+3-f(1)$ is $2 f(1)$, we have
$$
\left\{\begin{array}{l}
f(0)+3+f(1)=4 \\
f(0)+3-f(1)=2 .
\end{array}\right.
$$

Thus, $f(0)=0, f(1)=1$.
From condition (1), we get
$$
[f(2 n+1)+f(2 n)][f(2 n+1)-f(2 n)]=6 f(n)+1 .
$$

Assume $f(2 n+1)-f(2 n)=d$, then
$$
f(2 n+1)+f(2 n)=\frac{6 f(n)+1}{d} .
$$

Eliminating $f(2 n+1)$, we get
$$
2 f(2 n)+d=\frac{6 f(n)+1}{d},
$$

Thus, $2 d f(2 n)+d^{2}-1=6 f(n)$.
If $d>3$, then
$2 d f(2 n)+d^{2}-1>6 f(2 n) \geqslant 6 f(n)$, which is a contradiction.
If $d=2$ or 3, then $6 f(n)+1$ can also be divided by 2 or 3, which is a contradiction.
Therefore, $d=1$.
Thus, for all non-negative integers $n$, we have
$$
\begin{array}{l}
f(2 n)=3 f(n) . \\
f(2 n+1)=f(2 n)+1=3 f(n)+1 .
\end{array}
$$

If $k$ is even, then $f(k+1)=f(k)+1>f(k)$;
If $k$ is odd, since $f(1)>f(0)$, assume that for $n \leqslant k$, $f(n)>f(n-1)$, then
$$
f(k+1)=3 f\left(\frac{k+1}{2}\right) \geqslant 3\left[f\left(\frac{k-1}{2}\right)+1\right]>3 f\left(\frac{k-1}{2}\right)+1=f(k) .
$$

Therefore, $f$ is a strictly increasing function on $J^{\text {sul }}$.
$$
\begin{array}{l} 
f(127)=3 f(63)+1 \\
=3[3 f(31)+1]+1 \\
=3\{3[3 f(15)+1]+1\}+1 \\
=27 f(15)+13 \\
=27[3 f(7)+1]+13 \\
=81[3 f(3)+1]+40 \\
=243[3 f(1)+1]+121 \\
=10932008 .
\end{array}
$$

In summary, there are 128 values that satisfy being less than 2008 in the range of $f$.