24. Define $\operatorname{gcd}(a, b)$ as the greatest common divisor of integers $a$ and $b$. Given that $n$ is the smallest positive integer greater than 1000 and satisfies:
$$
\begin{array}{l}
\operatorname{gcd}(63, n+120)=21, \\
\operatorname{gcd}(n+63,120)=60 .
\end{array}
$$

Then the sum of the digits of $n$ is ( ).
(A) 12
(B) 15
(C) 18
(D) 21
(E) 24
24. C.
$$
\begin{array}{l}
\text { Given } \operatorname{gcd}(63, n+120)=21 \\
\Rightarrow 21 \text { divides } (n+120), 63 \text { does not divide } (n+120) \\
\Rightarrow n \equiv 6(\bmod 21) .
\end{array}
$$

Given $\operatorname{gcd}(n+63,120)=60$
$$
\begin{array}{l}
\Rightarrow 60 \text { divides } (n+63), 120 \text { does not divide } (n+63) \\
\Rightarrow n \equiv -3(\bmod 60) .
\end{array}
$$

Thus, $n \equiv 237(\bmod 420)$, i.e.,
$$
n=420 k+237(k \in \mathbf{Z}) \text {. }
$$

Since $n$ is the smallest positive integer greater than 1000 that satisfies the conditions, we have:
$$
\begin{array}{l}
n=420 \times 2+237=1077 \text {, } \\
n+120=1197=63 \times 19 \text { (discard); } \\
n=420 \times 3+237=1497 \text {, } \\
n+63=1560=120 \times 13 \text { (discard); } \\
n=420 \times 4+237=1917 \text {, } \\
n+120=2037,63 \nmid 2037, \\
n+63=1980,120 \nmid 1980 .
\end{array}
$$

Therefore, $n=1917$, and the required sum is $1+9+1+7=18$.