Generating Fermat primes
Python 2, 53 bytes



k=input();F=2
while k:F*=F;k-=3**(F/2)%-~F/F
print-~F


Try it online!

Uses Pépin's test.



Python 2, 54 bytes



f=lambda k,F=4:k and f(k-3**(F/2)%-~F/F,F*F)or F**.5+1


Try it online!