Question: Best algorithm to compute binomial coefficients modulo a prime

I've been googling for a while for a built-in function that computes {binomial(n,k) mod p} in Maple. The closest I've come to finding an answer is here: https://www.mapleprimes.com/questions/200986-Binomial-Coefficients , where the answer is given for p=2 and the method uses Lucas' theorem and relies completely in the binary nature of the problem. Is there any such function? If not, what would the most efficient way to handle this numbers be? Thanks for the help!

Please Wait...