找回密码
 欢迎注册
查看: 6189|回复: 2

[求助] 关于素数测试的问题

[复制链接]
发表于 2010-1-20 23:35:16 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?欢迎注册

×
在The Agrawal -Kayal -Saxena Test的素数测试中

Input: Integer n > 1  
if (n has the form ab with b > 1) then output COMPOSITE;
r := 2;
while (r < n) {  
   if (gcd(n,r) is not 1) then output COMPOSITE;
   if (r is prime greater than 2) then {
      let q be the largest factor of r-1;
      if (q > 4sqrt(r)log n) and (n^[(r-1)/q] is not 1 (mod r)) then  
          break;  
      }  
   r := r + 1;
}  
for a := 1 to 2sqrt(r)log n {  
   if ( (x-a)^n is not (x^n-a) (mod x^r-1,n) ) then output COMPOSITE;  
}  

output PRIME;


这句:
if ( (x-a)^n is not (x^n-a) (mod x^r-1,n) ) then output COMPOSITE;  
应该如何理解?
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2010-1-21 09:54:29 | 显示全部楼层
难道是分别用两个数对取模?
还是对应取模?
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2010-1-21 10:21:18 | 显示全部楼层
本帖最后由 wayne 于 2010-1-21 10:23 编辑

2# 无心人


http://en.wikipedia.org/wiki/AKS_primality_test
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
您需要登录后才可以回帖 登录 | 欢迎注册

本版积分规则

小黑屋|手机版|数学研发网 ( 苏ICP备07505100号 )

GMT+8, 2024-5-3 14:19 , Processed in 0.063419 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表