Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Fermat primality test
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Example == Suppose we wish to determine whether ''n'' = 221 is prime. Randomly pick 1 < ''a'' < 220, say ''a'' = 38. We check the above congruence and find that it holds: :<math>a^{n-1} = 38^{220} \equiv 1 \pmod{221}.</math> Either 221 is prime, or 38 is a Fermat liar, so we take another ''a'', say 24: :<math>a^{n-1} = 24^{220} \equiv 81 \not\equiv 1 \pmod{221}.</math> So 221 is composite and 38 was indeed a Fermat liar. Furthermore, 24 is a Fermat witness for the compositeness of 221.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)