<s>[INST] $\sum_{n=1}^{2017}\left(\left((n+2)^4\bmod{(n+1)^4}\right)\bmod{4}\right)$ 
What's
$$\sum_{n=1}^{2017}\left(\left((n+2)^4\bmod{(n+1)^4}\right)\bmod{4}\right)$$

What have I tried?
$$(n+2)^4=n^4+8n^3+24n^2+32n+16$$
$$(n+1)^4=n^4+4n^3+6n^2+4n+1$$
Remainder:
$$4n^3+18n^2+28n+15$$
mod:
$$2n^2-1\pmod{4}$$
I can compute $\sum x^2$ but I don't know what to do with $$\sum_{n=1}^{2017}\left(2n^2-1\mod{4}\right)$$
 [/INST] 
Here
  $$\{\}\text{ is the fractional part function}$$
  So we can write, (if you have problem with this part please comment)
  $$\text{a mod b}= \{\frac{a}{b}\} b$$

$$\sum_{n=1}^{2017} \{\frac{2 n^2-1}{4}\} 4$$
$$\sum_{n=1}^{2017} \{\frac{ n^2}{2}-\frac{1}{4}\} 4$$

$$\{\frac{ n^2}{2}-\frac{1}{4}\}= \frac {1}{4}  \text { for } n\in odd$$
  $$ =\frac{3}{4} \text{ for }n \in even $$

$$\sum_{n=1}^{1009} \frac{1}{4}4 +\sum_{n=1}^{1008} \frac{3}{4} 4$$
$$\sum_{n=1}^{1009} 1 +\sum_{n=1}^{1008}  3 $$
$$1009 + 3 × 1008$$

$$4033$$

</s>