关于素数的一些结论
費馬測試(Fermat test)
Some of the cryptographic algorithms make use of big prime numbers. However, checking if a big number is prime is not so easy. However, some probabilistic tests exist that offer high confidence at low cost. One of them is the Fermat test.
Let $a$ be a random number between $2$ and $n-1$ (being $n$ the number whose primality we are testing). Then, $n$ is probably prime if the following equation holds:
$$a^n \bmod n = a$$
If a number passes the Fermat test several times then it is prime with a high probability.
費馬小定理
若 $p$ 是素數,則對任意正整數 $x$ 都有
$$x^p \equiv x \pmod{p}$$
轉載于:https://www.cnblogs.com/Patt/p/6097394.html
總結
- 上一篇: windows证书地址
- 下一篇: 排序陷阱 List.Sort Linq.