Binomial Coefficient involving Prime

Theorem
Let $$p$$ be a prime number.

Let $$\binom n p$$ be a binomial coefficient.

Then:
 * $$\binom n p \equiv \left \lfloor {\frac n p}\right \rfloor \pmod p$$

where:
 * $$\left \lfloor {\frac n p}\right \rfloor$$

denotes the floor function.

Proof
Follows directly from Lucas' Theorem:


 * $$\binom n k \equiv \binom {\left \lfloor {n / p} \right \rfloor} {\left \lfloor {k / p} \right \rfloor} \binom {n \, \bmod \, p} {k \, \bmod \, p} \pmod p$$

When $$k = p$$ we have that:
 * $$k \, \bmod \, p = 0$$ and so:
 * $$\binom {n \, \bmod \, p} {k \, \bmod \, p} = 1$$


 * $$\left \lfloor {k / p} \right \rfloor = 1$$ and so:
 * $$\binom {\left \lfloor {n / p} \right \rfloor} {\left \lfloor {k / p} \right \rfloor} = \left \lfloor {n / p} \right \rfloor$$