The Miller-Rabin primality test first handles as prime and or even as composite. For odd , write with odd and choose a base . A nontrivial proves compositeness. Otherwise compute : the round passes if or . If neither holds, square successively, at most times, and pass if a value occurs; otherwise declare composite. An occurrence of before exhibits a nontrivial square root of one and is also a failure. For prime , Fermat's theorem and the fact that a field has only the square roots force a pass. The standard strong-liar bound says that an odd composite passes for at most one quarter of the bases; independent random rounds therefore have error probability at most after rounds. Passing is a probable-prime verdict, not a proof of primality. A Fermat pseudoprime is composite and passes ; a strong pseudoprime is composite and passes the stronger round above.

Articles by others on the same topic (0)

There are currently no matching articles.