4. Simplify:
$$
\cos \frac{2 \pi}{2015}+\cos \frac{4 \pi}{2015}+\cdots+\cos \frac{2014 \pi}{2015}=
$$
$\qquad$
$\begin{array}{l}\text { 4. }-\frac{1}{2} \text {. } \\ \cos \frac{2 \pi}{2015}+\cos \frac{4 \pi}{2015}+\cdots+\cos \frac{2014 \pi}{2015} \\ =\sum_{k=1}^{1007} \cos \frac{2 k \pi}{2015} \\ =\frac{1}{\sin \frac{\pi}{2015}} \sum_{k=1}^{1007}\left[\sin \frac{(2 k+1) \pi}{2015}-\sin \frac{(2 k-1) \pi}{2015}\right] \\ =\frac{\sin \pi-\sin \frac{\pi}{2015}}{2 \sin \frac{\pi}{2015}}=-\frac{1}{2} \text {. } \\\end{array}$