3. Let $f(n)$ be the sum of the squares of the digits of the positive integer $n$ (in decimal), for example, $f(123)=1^{2}+2^{2}+3^{2}=14$. Let
$$
\begin{array}{l}
f_{1}(n)=f(n), \\
f_{k+1}(n)=f\left(f_{k}(n)\right)(k=1,2, \cdots) .
\end{array}
$$

Then $f_{2006}(2006)=(\quad)$.
(A) 20
(B) 4
(C) 42
(D) 145
3.D.

Let $f(2006)=40$ be denoted as $2006 \rightarrow 40$, then we have
$$
\begin{array}{l}
2006 \rightarrow 40 \rightarrow 16 \rightarrow 37 \rightarrow 58 \rightarrow 89 \rightarrow 145 \rightarrow 42 \rightarrow 20 \rightarrow 4 \\
\rightarrow 16 \rightarrow \cdots
\end{array}
$$

Starting from 16, $f_{n}(2006)$ is a periodic sequence with a period of 8. Therefore, $f_{2006}(2006)=f_{2004}(16)=f_{4+230 \times 8}(16)$
$$
=f_{4}(16)=145 .
$$