费马小定理

费马小定理

对于任何互质数a,p,有

ap-1=1(mod p)

就是ap=a(mod p)

应用

求逆元

ap-2*p=1(mod p)

原文地址:https://www.cnblogs.com/BrotherHood/p/12872305.html