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
Quadratic residue
(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!
===Primality testing=== [[Euler's criterion]] is a formula for the Legendre symbol (''a''|''p'') where ''p'' is prime. If ''p'' is composite the formula may or may not compute (''a''|''p'') correctly. The [[Solovay–Strassen primality test]] for whether a given number ''n'' is prime or composite picks a random ''a'' and computes (''a''|''n'') using a modification of Euclid's algorithm,<ref>{{Harvnb|Bach|Shallit|1996|p=113}}</ref> and also using Euler's criterion.<ref>{{Harvnb|Bach|Shallit|1996|pp=109–110}}; Euler's criterion requires O(log<sup>3</sup> ''n'') steps</ref> If the results disagree, ''n'' is composite; if they agree, ''n'' may be composite or prime. For a composite ''n'' at least 1/2 the values of ''a'' in the range 2, 3, ..., ''n'' − 1 will return "''n'' is composite"; for prime ''n'' none will. If, after using many different values of ''a'', ''n'' has not been proved composite it is called a "[[probable prime]]". The [[Miller–Rabin primality test]] is based on the same principles. There is a deterministic version of it, but the proof that it works depends on the [[generalized Riemann hypothesis]]; the output from this test is "''n'' is definitely composite" or "either ''n'' is prime or the GRH is false". If the second output ever occurs for a composite ''n'', then the GRH would be false, which would have implications through many branches of mathematics.
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)