6. Let $a_{n}=1+2+\cdots+n\left(n \in \mathbf{Z}_{+}\right)$,
$$
S_{m}=a_{1}+a_{2}+\cdots+a_{m}(m=1,2, \cdots) \text {. }
$$

Then among $S_{1}, S_{2}, \cdots, S_{2017}$, the numbers that are divisible by 2 but not by 4 are $\qquad$ in number.
6.252 .

Notice that, $S_{m}=\frac{m(m+1)(m+2)}{6}$.
Thus $S_{m} \equiv 2(\bmod 4)$
$$
\begin{array}{l}
\Leftrightarrow m(m+1)(m+2) \equiv 4(\bmod 8) \\
\Leftrightarrow m \equiv 3(\bmod 8) .
\end{array}
$$

Therefore, among $S_{1}, S_{2}, \cdots, S_{2017}$, the numbers that are divisible by 2 but not by 4 are $\left[\frac{2017}{8}\right]=252$ in total.