What witnesses do i need for Rabin-Miller test for numbers up to 10¹⁸?

女生的网名这么多〃 提交于 2019-12-11 06:58:57

问题


What set of witnesses is sufficient for the Miller-Rabin test to be correct for all numbers up to 10¹⁸? I know that use of primes up to 17 as witnesses suffices for n < 341550071728321.


回答1:


According to this record page, the set of 7 SPRP bases: {2, 325, 9375, 28178, 450775, 9780504, 1795265022} is sufficient for a deterministic test to at least n = 2^64 ( > 10^19).




回答2:


According to OEIS, use of witnesses up to 23 suffices for numbers up to 3825123056546413051




回答3:


If you're willing to use a Baillie-Wagstaff test instead of a Miller-Rabin test, it has been certified to be error-free in classifying primes up to 2^64. The coding is not much more complicated, the function executes more quickly than a Miller-Rabin test, and there are no known errors of classification.



来源:https://stackoverflow.com/questions/22194207/what-witnesses-do-i-need-for-rabin-miller-test-for-numbers-up-to-10%c2%b9%e2%81%b8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!