Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Prime numbers and primality tests
Replies: 4   Last Post: Jan 22, 2013 11:18 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
John Feth

Posts: 5
Registered: 3/8/10
Prime numbers and primality tests
Posted: Jan 14, 2013 11:28 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

A straightforward way to test a prime number candidate is the Miller-Rabin test (sometimes called the Rabin-Miller test). This well known and popular test is commonly executed 50 times on a candidate prime and has a proven probability of missing a non-prime of no more than 0.25 for each execution. Note that passing 50 Miller-Rabin tests (which is a de facto standard), the probability of non-primality is 0.25^50 ~ 7.9*10^-31, I'm satisfied that the number NextPrime gives me is "prime enough". Mathematica uses the Miller-Rabin test, although it is not clear how many iterations are used. As I understand it, Mathematica also the Lucas pseudo prime test on the Miller-Rabin output.

It is interesting to note, however, that the Lucas pseudo prime method of primality testing apparently does not have the handy "feature" of the Miller-Rabin test, namely, the provable, and bounded low probability of a wrong answer, from whence an estimate of primality for any number can be made without finding a counter example!

I've read that there are have been no counter-examples (viz., no non-primes that pass the the Lucas pseudo prime test) to numbers that pass the Lucas pseudo prime test, but then again, I've never found an oyster with a pearl inside.

Is the Miller-Rabin a better test that the Lucas pseudo prime test?


http://reference.wolfram.com/mathematica/tutorial/IntegerAndNumberTheoreticalFunctions.html

http://reference.wolfram.com/mathematica/tutorial/SomeNotesOnInternalImplementation.html

http://mathworld.wolfram.com/LucasPseudoprime.html




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.