Fermat定理:

    如果P是任意一个不能整除整数a的素数,则  【原】费马小定理(Fermat little theorem)详解

之后我会展示一些用到这一经典定理的算法。

 

例如:

【原】费马小定理(Fermat little theorem)详解【原】费马小定理(Fermat little theorem)详解 等等

 

证明:

考虑a的倍数: 【原】费马小定理(Fermat little theorem)详解 

(1) 证明这些整数中任意两个都不能模p同余。

     反证法:假设  【原】费马小定理(Fermat little theorem)详解 ,即

     【原】费马小定理(Fermat little theorem)详解

     这不可能,因为p为素数且s-r<p,p不能整除a,所以p不可能是(s-r)a的因子。得证结论。

(2) 证明这些数中没有一个能和0同余。

     证明:因为1, …, (p-1)都小于p,且p为素数,p不能整除a,因此p不能整除 【原】费马小定理(Fermat little theorem)详解

(3) 【原】费马小定理(Fermat little theorem)详解 , 当且仅当d为素数,则 【原】费马小定理(Fermat little theorem)详解【原】费马小定理(Fermat little theorem)详解

 

由(1)和(2)可得, 【原】费马小定理(Fermat little theorem)详解 必须对应于余数1, 2, 3, …, (p-1)。根据同余式乘法性质可得:

【原】费马小定理(Fermat little theorem)详解

                         【原】费马小定理(Fermat little theorem)详解 

【原】费马小定理(Fermat little theorem)详解

【原】费马小定理(Fermat little theorem)详解 

【原】费马小定理(Fermat little theorem)详解

由(3)可知,因为k不能整除p,且p为素数,所以 【原】费马小定理(Fermat little theorem)详解 必须被p整除,即得费马小定理 【原】费马小定理(Fermat little theorem)详解

 

需要注意的是:

1. 费马定理是,已知素数p,得到 【原】费马小定理(Fermat little theorem)详解。但是已知 【原】费马小定理(Fermat little theorem)详解 并不能确定p是素数。

2. 若 【原】费马小定理(Fermat little theorem)详解 ,则p一定为合数(费马定理的逆反命题)。

相关文章: