I was given the following problem:
Let $g(n)$ be the smallest prime that divides $n^4+1$. What is the remainder of $g(1)+g(2)+...+g(2015)$ when divided by $8$?
My attempt so far:
Instead of summing up then divide $8$, i tried to find the remainder of each individual $g(n)$ when divided by $8$, then sum them up, and reduce it with modular arithmetic. So clearly for $n$ odd, $g(n)$ leaves a remainder of $2$ when divided by $8$. But for $n$ even I have no clue how to proceed.
If you can help solving this, I will greatly appreciate it.