最快的算法素性测试素性、算法、最快、测试

2023-09-11 22:36:29 作者:把心掐死算了

我需要测试素数上是真正的大(在很长很长的范围内)的数字之间的间隔,所以我需要一些快速的算法,用于检查数是素与否。请提出你的想法。

I need to test primality on intervals between numbers which are really big (in the range of long long), so i need some fast algorithm for checking if a number is prime or not. Please suggest your ideas.

推荐答案

一个很好的方法是 Miller-拉宾测试。应当指出然而,这仅仅是一个概率测试

One good method is the Miller-Rabin test. It should be noted however, that this is only a probabilistic test.