Modular Congruence of the Fermat Numbers

I'm just trying to study for exam season and got stuck on a question; which I'm not really sure how to tackle.. looking through all my lecture notes I just can't seem to see what techniques are required here.

Let $n\geq 2$ be a positive integer and assume that $p:= 2^{2^n}+1$ is a prime number.

(i) Show that $p\equiv 2\pmod 5$

I can see $p$ is a Fermat number so I can assume it must be something to do with the properties of them but I just can't seem to be making the connection.. any insight is much appreciated!

• $2^4 \equiv 1 \pmod 5$. – Donald Splutterwit Apr 17 '17 at 13:41
• My edit was to change $n\leq 2$ to $n\geq 2$..... Whether or not $p$ is prime is irrelevant to this Q. – DanielWainfleet Apr 17 '17 at 18:19

Let $p_n=2^{2^n}+1.$
Method 1... $2^4=16\equiv 1 \pmod 5.$ For $n\geq 2$ we have $2^n/4\in \mathbb N$ so $p_n=1+(2^4)^{(2^n/4)} \equiv 1+1^{(2^n/4)}\equiv 1+1 \pmod 5.$
Method 2... $p_2=17\equiv 2 \pmod 5.$ If $p_n\equiv 2 \pmod 5$ then $p_{n+1}=1+(p_n-1)^2\equiv 1+(2-1)^2\equiv 2 \pmod 5.$ By induction on $n\geq 2$ we have it.