知识卡片
连平方序列四种终态区分证人
连平方序列若末值不是1,或最后一个非1值既不是−1也不是1,则底数是合数证人;
全为1或最后一个非1值为−1,则该底数不提供合数证据。
后一种结果不能单独证明n为素数。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 第31章 数论算法 · 查看原书依据
, 1〉, where d ≠ ±1: the sequence X ends in 1, but the last non-1 is not –1. Return TRUE in line 6: a is a witness to the compositeness of n, since d is a nontrivial square root of 1. Now,
参考来源
- 位置:《算法导论(第4版)》第31章《数论算法》(OEBPS/chapter031.xhtml,文本字符[84524,85180))。
- 结论依据:原书第31.8节的素性判定方法、证人伪代码或定理;相关公式图已核对。
- 原始内容:There are four cases: X = 〈 …, d 〉 , where d ≠ 1: the sequence X does not end in 1. Return TRUE in line 8, since a is a witness to the compositeness of n (by Fermat’s Theorem). X = 〈 1, 1, …, 1 〉 : the sequence X is all 1s. Return FALSE , since a is not a witness to the compositeness of n . X = 〈 …, –1, 1, …, 1 〉 : the sequence X ends in 1, and the last non-1 is equal to –1. Return FALSE , since a is not a witness to the compositeness of n . X = 〈 …, d , 1, …, 1 〉 , where d ≠ ±1: the sequence X ends in 1, but the last non-1 is not –1. Return TRUE in line 6: a is a witness to the compositeness of n , since d is a nontrivial square root of 1. Now,