calculate nCr given (n-1)C(r-1) under a modulo fast

73 Views Asked by At

Let $_nC_r$ be n choose r or $\frac{n!}{(r!*(n-r)!)}$

Given the value of $_nC_r$ for some n, r, equal to k, how could one find $_{n+1}C_{r+1}$ (mod m) fast computationally (small asymptotic time).

The best I can come up with is $_{n+1}C_{r+1}= {_nC_r}(\frac{n+1}{r+1})$, but this only works if there are no mods.

So my question is, how can one find $_{n+1}C_{r+1} (mod m)$ after being given $_nC_r$ (mod m), where m is some large prime.