Wilson 定理
威尔逊定理 | |
---|---|
术语名称 | 威尔逊定理 |
英语名称 | Wilson's theorem |
威尔逊定理(Wilson's theorem)指质数模下,阶乘与 -1 同余,
可以更广泛地推广为,一些特殊的模下,简化剩余系的累积与 -1 同余。
定理
[math]\displaystyle{ p }[/math] 是质数,当且仅当 [math]\displaystyle{ (p-1)! \equiv -1 \pmod p }[/math] 。
扩展
如果考虑同余式左侧换为一个简化剩余系时,这一同余式对模数为 1、2、4、奇质数幂 [math]\displaystyle{ p^l }[/math] 、 [math]\displaystyle{ 2 p^l }[/math] 的情况仍然成立,即:
[math]\displaystyle{ \prod_{0 \lt k \lt n,\operatorname{gcd}(k,n)=1} k \equiv -1 \pmod n }[/math]
[math]\displaystyle{ p }[/math] 是质数只是恰好使得同余式左侧变为阶乘形式。
性质
考虑 [math]\displaystyle{ (n-1)! }[/math] 模 [math]\displaystyle{ n }[/math] 的最小非负剩余,有:
- 若 [math]\displaystyle{ n }[/math] 为质数,有 [math]\displaystyle{ (n-1)! \equiv n-1 \pmod n }[/math] 。
- 若 [math]\displaystyle{ n = 4 }[/math],有 [math]\displaystyle{ (n-1)! \equiv 2 \pmod n }[/math] 。
- 其他情况下,有 [math]\displaystyle{ (n-1)! \equiv 0 \pmod n }[/math] 。