用Miller-Rabin算法进行大素数判断以及Pollard-rho算法进行分解的模版
ll pri[]={
2,7,61};//用小素数表做随机种子可避免第一类卡米歇尔数的误判
/*
if n < 1,373,653, it is enough to test a = 2 and 3;
if n < 9,080,191, it is enough to test a = 31 and 73;
if n < 4,759,123,141, it is enough to test a = 2, 7, and 61;
if n < 1,122,004,669,633, it is enough to test a = 2, 13, 23,

本文介绍了一种使用Miller-Rabin算法进行大素数判断的方法,并提供了Pollard-rho算法用于分解大数的实现模板。该模板适用于小于特定阈值的大数,通过选取合适的基数集来提高判断效率。
1833

被折叠的 条评论
为什么被折叠?



