Tina Town is a friendly place. People there care about each other. Tina has a ball called zball. Zball is magic. It grows larger every day. On the first day, it becomes 11 time as large as its original size. On the second day,it will become 22 times
Lucas 定理(证明) A.B是非负整数,p是质数.AB写成p进制:A=a[n]a[n-1]...a[0],B=b[n]b[n-1]...b[0]. 则组合数C(A,B)与C(a[n],b[n])*C(a[n-1],b[n-1])*...*C(a[0],b[0]) mod p 相同 即:Lucas(n,m,p)=c(n%p,m%p)*Lucas(n/p,m/p,p) 证明: 首先我们注意到 n=(ak...a2,a1,a0)p = (ak...a2,a1)p * p + a0 = [n