GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing mathworld.wolfram.com — Primality Test -- from Wolfram MathWorld Primality TestA primality test is a test to determine whether or not a given number is prime, as opposed to actually decomposing the number into its constituent prime factors (which is known as prime factorization). Primality tests come in two varieties: deterministic and probabilistic. Deterministic tests determine with absolute certainty whether a number is prime. Examples of deterministic tests include the Lucas-Lehmer test and elliptic curve primality proving. Probabilistic tests can potentially (although with very small probability) falsely identify a composite number as prime (although not vice versa). However, they are in general much faster than deterministic tests. Numbers that have passed a probabilistic prime test are therefore properly referred to as probable primes until their primality can be demonstrated deterministically.
For an odd integer A number that passes a probabilistic test but is in fact composite is known as a pseudoprime. There are many specific types of pseudoprimes, the most common being the Fermat pseudoprimes, which are composites that nonetheless satisfy Fermat's little theorem. The Rabin-Miller strong pseudoprime test is a particularly efficient test. The Wolfram Language implements the multiple Rabin-Miller test in bases 2 and 3 combined with a Lucas pseudoprime test as the primality test used by the function PrimeQ[n]. Like many such algorithms, it is a probabilistic test using pseudoprimes. In order to guarantee primality, a much slower deterministic algorithm must be used. As of Oct. 2026, no composite number is known to pass the Baillie-PSW primality test.
The state of the art in deterministic primality testing for arbitrary numbers is elliptic curve primality proving.
As of Oct. 2026, the largest number certified by the program PRIMO
is the repunit prime
Unlike prime factorization, primality testing was long believed to be a P-problem (Wagon 1991). This
had not been demonstrated, however, until Agrawal et al. (2002) unexpectedly
discovered a polynomial time algorithm for primality
testing that has asymptotic complexity of See alsoAdleman-Pomerance-Rumely Primality Test, AKS Primality Test, Elliptic Curve Primality Proving, Fermat Pseudoprime, Fermat's Little Theorem, Fermat's Little Theorem Converse, Fermat's Theorem, Lucas-Lehmer Test, Miller's Primality Test, Pépin's Test, Pocklington's Theorem, Prime Factorization Algorithms, Probable Prime, Proth's Theorem, Pseudoprime, Rabin-Miller Strong Pseudoprime Test, Ward's Primality Test, Wilson's TheoremExplore with Wolfram|AlphaMore things to try: ReferencesAgrawal, M.; Kayal, N.; and Saxena, N. "PRIMES is in P." Ann. Math. 160, 781-793, 2004. https://doi.org/10.4007/annals.2004.160.781.Beauchemin, P.; Brassard, G.; Crépeau, C.; Goutier, C.; and Pomerance, C. "The Generation of Random Numbers That Are Probably Prime." J. Crypt. 1, 53-64, 1988.Bernstein, D. J. "An Exposition of the Agrawal-Kayal-Saxena Primality-Proving Theorem." 2002. https://cr.yp.to/papers/aks-20020820.pdf.Brillhart, J.; Lehmer, D. H.; and Selfridge, J. L. "New Primality Criteria and Factorizations ofReferenced on Wolfram|AlphaPrimality TestCite this as:Weisstein, Eric W. "Primality Test." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/PrimalityTest.html Subject classifications |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |