# Math Help - help with Pepin's primatlity test

1. ## help with Pepin's primatlity test

In class today, the prof explained Pepin's test, but I got lost midway. This is what I have so far:
Let $F_{n}=2^{2^n}+1$, then $\frac{F_{n}-1}{2}=2^{2^n-1}$ Call this number $q$.
If $3^q \equiv -1 (mod$ $F_{n})$ (1), then $3^{2q} \equiv 1(mod$ $F_{n})$. Because of (1), 2q is the order. What I don't understand is how this shows that $F_{n}$ is prime. I also don't get how $F_{n} \equiv 2(mod$ $3)$.
Any help is much appreciated.