Euler's theorem proving & inverse factorial

Euler's theorem: https://www.cnblogs.com/wangxiaodai/p/9758242.html

Factorial inverse:

记    f[i] = i! mod p,

  g[i] = (i!)−1 mod p

Easy to find g [i] = g [i ] + 1 * (i +1)

      i−1 = f[i]−1∗g[i]

Only calculating f [n], is obtained and f [n] The inverse element g [n], and can be recursive. 

Guess you like

Origin www.cnblogs.com/minun/p/11367417.html