※ 引述《jerry900287 ()》之銘言:
: 如圖 http://i.imgur.com/vTDlhAG.png
: 想請教各位大大
: 看了解答之後
: 題目的(mod m)是用來幹嘛的QQ
: 感覺好像沒有甚麼用處阿
n為整數
a_(n-1) = (n-1)! (mod m)
=> na_(n-1) = n[(n-1)!] (mod m)
=> na_(n-1) = n! (mod m)
又因為a_n = n! (mod m)
=> a_n = na_(n-1) (mod m) for n >= 2
因為a_1 = 1 (mod m)
可令a_0 = 1
使a_n = na_(n-1) (mod m) for n >= 1