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
Solovay–Strassen 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 if {{math|1=''n'' = 221}} is prime. We write (''n''−1)/2=110. We randomly select an ''a'' (greater than 1 and smaller than ''n''): 47. Using an efficient method for raising a number to a power (mod ''n'') such as [[Modular exponentiation#Left-to-right binary method|binary exponentiation]], we compute: * {{math|1=''a''<sup>(''n''−1)/2</sup> mod ''n'' = 47<sup>110</sup> mod 221 = −1 mod 221}} * <math>\left(\tfrac{a}{n}\right) \bmod n = \left(\tfrac{47}{221}\right) \bmod 221 = -1 \bmod 221</math> This gives that, either 221 is prime, or 47 is an Euler liar for 221. We try another random ''a'', this time choosing {{math|1=''a'' = 2}}: * {{math|1=''a''<sup>(''n''−1)/2</sup> mod ''n'' = 2<sup>110</sup> mod 221 = 30 mod 221}} * <math>\left(\tfrac{a}{n}\right) \bmod n = \left(\tfrac{2}{221}\right) \bmod 221 = -1 \bmod 221</math>. Hence 2 is an Euler witness for the compositeness of 221, and 47 was in fact an Euler liar. Note that this tells us nothing about the prime factors of 221, which are actually 13 and 17.
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)