Algorithm and Running Time
The algorithm can be written as follows:
Inputs: n: a value to test for primality; k: a parameter that determines the number of times to test for primality Output: composite if n is composite, otherwise probably prime repeat k times: pick a randomly in the range if, then return composite return probably primeUsing fast algorithms for modular exponentiation, the running time of this algorithm is O(k × log2n × log log n × log log log n), where k is the number of times we test a random a, and n is the value we want to test for primality.
Read more about this topic: Fermat Primality Test
Famous quotes containing the words running and/or time:
“Frances Stevens: Mother, this is why Ive had to spend half my life running around the world after youto keep men like this away from you.
Mrs. Stevens: Well after this, let me run my own interference. It looks like the blockers are having all the fun.”
—John Michael Hayes (b. 1919)
“A big man has no time really to do anything but just sit and be big.”
—F. Scott Fitzgerald (18961940)
Related Phrases
Related Words