I was reading about the Lucas theorem, and encountered a resource here.
I understand the argument it is making, but slightly thrown off by this line here: "Note this argument only works when p is prime."
My question is: why is it that this argument only works when p is prime?
$k{p^r\choose k}= p^r{p^r-1 \choose k-1}$ where $0 < k < p^r$ implies that ${p^r\choose k}$ is divisible by $p$.
For example, it seems to me to work with $p=4$ and $r=4$ for example. Clearly the right side is still divisible by $4^4$, whereas k cannot possibly be divisible by $4^4$ since it is less than $p^r$.
But $k$ could be equal to $2^7 =\frac{4^4}2$, for example. In this case, you can only conclude that ${p^r \choose k}$ is divisible by $2$, not by $4$. That can't happen when $p$ is prime.
As Brian Moehring pointed out in the comments, it's not only true that the conclusion method fails, but that ${4^4 \choose 2^7}$ is actually not divisble by $4$.
To see that, we start with the equality given in the problem, for our special counter example
$$2^7{4^4 \choose 2^7} = 4^4{4^4-1 \choose 2^7-1}$$
and divide by $2^7$ $${4^4 \choose 2^7} = 2{4^4-1 \choose 2^7-1}.$$
We now have
$${4^4-1 \choose 2^7-1} = \frac{(4^4-1)\times(4^4-2)\times\ldots\times(2^7+1)}{1\times 2 \times \ldots \times (2^7-1)}$$
Note that in that quotient the $i$-th factor in the enumerator and the $i$-th factor in the denominator add up to exactly $4^4$. That means the powers of $2$ contained in the $i$-th factor in the enumerator are exactly the same as in the $i$-the factor in the denominator. That means after cancelling all those powers of $2$, you are left with a product of of odd numbers in both enumerator and denominator, which means ${4^4-1 \choose 2^7-1}$ is odd, proving what Brian said.