Find the remainder of $2^n+n^2$ modulus 6 
Find the remainder of $2^n+n^2$ modulus 6 given that $2^n+n^2$ is a prime and $n\geq2$($n$ positive integer)  

I tried to solve this but failed!I just know that $n$ must be odd. No progress at all!!

For $n=3$ reminder is $5$.
If $n$ is even, then $2^n+n^2$ is also even, hence not prime.
Therefore, we should only consider odd numbers $n$.
In fact, we should consider only cases $n=6k\pm 1$, $n=6k\pm 3.$
Since $$2^n+n^2=2^n+1+(6k\pm1)^2-1=3(2^{n-1}-2^{n-2}+\dots-1)+6T=0\mod 3,$$ this number is not prime for $n=6k\pm 1$, so it only remains to check case $n=6k\pm 3$:
$$2^n+n^2=2^n+(6k\pm 3)^2=2^n+3\mod 6=2^n+1+2\mod 6,$$
$$2^n+n^2=(2+1)(2^{n-1}-2^{n-2}+\dots+2-1)+2\mod 6=6C-3+2\mod 6,$$
$$2^n+n^2=5\mod 6.$$
Finally, we can conclude that desired reminder is $5$.
