> 
> Let $N = ap$ be a composite positive integer, where $a > 1$ is a positive integer and $p$ is a prime. Prove that $$\binom{ap}{p} \equiv a \pmod{ap}.$$
> 
> 
> 

We have $$\binom{ap}{p} = \dfrac{ap(ap-1) \cdots (ap-(p-1))}{p!} = \dfrac{a(ap-1)(ap-2) \cdots (ap-(p-1))}{(p-1)!}.$$ If $p$ is the smallest prime factor of $ap$, then $(p-1)!$ has an inverse modulo $ap$. Also, $(ap-1)(ap-2) \cdots (ap-(p-1)) \equiv (-1)^{p-1} (p-1)!$. If $p = 2$, then $$\binom{ap}{p} \equiv a \cdot \dfrac{-(p-1)!}{(p-1)!} \equiv -a \equiv a \pmod{ap}.$$ Otherwise, if $p > 2$ is odd then $$\binom{ap}{p} \equiv a \cdot \dfrac{(p-1)!}{(p-1)!} \equiv a \pmod{ap}.$$ How do we prove it in the case that $p$ is not the smallest prime factor of $ap$?