8. Let $M=\{1,2, \cdots, 2017\}$ be the set of the first 2017 positive integers. If one element is removed from $M$, and the sum of the remaining elements in $M$ is exactly a perfect square, then the removed element is $\qquad$ .
$$
1+2+\cdots+2017=\frac{2017 \cdot 2018}{2}=2017 \cdot 1009=2035153,1426^{2}=2033476 \text {, }
$$

So the removed element is $2035153-2033476=1677$.