For how many integers $$k$$ between 1 and 2017 inclusive can the polynomial $\displaystyle 1+x+x^2+x^3 + \cdots +x^k=\sum_{n=0}^{k}x^n$ be expressed as a product of quadratics with real coefficients?