4. Let the sequence of positive numbers $a_{1}, a_{2}, \cdots, a_{n}$ be the irreducible proper fractions with a denominator of 60. Then $\sum_{i=1}^{\pi} \cos \frac{a_{i} \pi}{2}=(\quad)$.
(A) 0
(B) 8
(C) 16
(D) 30
4. (A).

Given $60=2^{2} \times 3 \times 5$, the numerators of $a$ in order are
$$
1,7,11,13,17,19,23,29,31,37,41,43,47,49 \text {, }
$$
53,59, a total of 16 (which can be calculated using the principle of inclusion and exclusion), and $a_{i}+a_{17-i}=1$ (the sum of terms equidistant from the start and end is 1), we have
$$
\begin{array}{l}
\sum_{i=1}^{n} \cos a_{i} \pi=\sum_{i=1}^{10} \cos a_{i} \pi=\sum_{i=1}^{\pi}\left(\cos a_{i} \pi+\cos a_{17-i} \pi\right) \\
=\frac{1}{2} \sum_{i=1}^{0} \cos \frac{\left(a_{i}+a_{17-i}\right) \pi}{2} \cdot \cos \frac{\left(a_{i}-a_{17-i}\right) \pi}{2} \\
=\frac{1}{2} \sum_{i=1}^{0} \cos \frac{\pi}{2} \cdot \cos \frac{\left(a_{i}-a_{17-i}\right) \pi}{\hat{\varepsilon}}=0 .
\end{array}
$$