Lucas Theorem based function that returns nCr % p . This function works like decimal to binary conversion recursive function . First we compute last digits of n and r in base p , then recur for remaining digits
def nCrModpLucas ( n , r , p ) : NEW_LINE