Pépin's Theorem
The Fermat number F_n is prime iff
| 3^(2^(2^n-1))=-1 (mod F_n). |
See also
Fermat Number, Pépin's Test, Selfridge-Hurwitz ResidueExplore with Wolfram|Alpha
WolframAlpha
More things to try:
Cite this as:
Weisstein, Eric W. "Pépin's Theorem." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/PepinsTheorem.html