Mathematical Notes - Number Theory - Miller-Rabin algorithm

For the primality of large numbers of judgment, Miller-Rabin algorithm is currently the most widely used. General base number is still randomly selected, but when the number of the test is not too large, there are some tips for selecting a base number test. For example, if the number is less than the measured 4759123141, then only need to test three base-2, 7 and 61 is sufficient. Of course, the more you test, the correct range is certainly greater. If you always use before seven prime number (2, 3, 5, 7, 11, 13 and 17) were tested, all no more than 341,550,071,728,320 numbers are correct. If you use 2, 3, 7, 61, and a base number 24251, then only 10 ^ strong pseudo-prime within 16 46856248255981. Such conclusions make Miller-Rabin algorithm in OI very practical. Is generally believed that the accuracy of Miller-Rabin primality test can be acceptable, were randomly selected k-base-error rate testing algorithm is approximately 4 ^ (- k).

References:

Prime numbers and primality testing (Miller-Rabin test) - Norlan - blog Park

Guess you like

Origin www.cnblogs.com/KisekiPurin2019/p/11804467.html