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!!
 A: $n$ can't be even because then $n^2+2^n$ is even and larger than $2$.
Therefore $n$ is odd and $2^n\equiv 2\bmod 3$. Notice that $n^2$ can only be $1$ or $0\bmod 3$.  In the first case $3$ divides $2^n+n^2$ and $n>3$, implying $2^n+n^2$ is not prime.
We conclude $n^2\equiv 0\bmod 3$. Therefore $2^n+n^2$ is odd and $2\bmod 3$. So $2^n+n^2\equiv 5\bmod 6$
A: clearly any Prime is congruence $1$ or $5$ mod $6$.
now suppose it would be 1.
as you mentioned n is odd. So
$n^2+2^n=n^2+(-1)^{odd}\equiv1 \pmod3$ 
so 
$n^2\equiv2\pmod3$ 
which is contradiction. It implies that answer is 5
A: 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$.
A: 2^n is never odd, so n^2 has to be odd to give a prime, n is odd
2^n with n odd is 4^k 2, 4^k = 4 mod 6, so 
2^n = 2 mod 6 here
n is 1, 3 or 5 mod 6
n^2 is 1 or 3 mod 6
if n^2 = 1 mod 6, then 2^n + n^2 = 3 mod 6, which would mean that when divided by 6, then 3 would remain, meaning that 2^n + n^2 divides by 3 and is not prime
so n^2 = 3 mod 6
2^n + n^2 = = 5 mod 6 
