# Radix representation and a congruent relation

Let $\epsilon_p(n)=\lfloor {n/p}\rfloor+ \lfloor {n/p^2}\rfloor+\cdots$ i.e the largest poswer of $p$ (prime) that divides $n!$ where $n$ is an integer.

Let $(\alpha_0\ldots\alpha_m)$ be a epresentation of $n$ with respect to the base $p$.

How can we show that

$$n!/p^{\epsilon_p(n)}\equiv (-1)^{\epsilon_p(n)} \alpha_0!\ldots\alpha_m!\ (\textrm{mod } p) ?$$

Any help is really appreciated.

-

$n!/p^{\epsilon_p(n)}\bmod p$ is the residue of the product of the last non-zero digits in all the factors in $n!$. Every factor of $p$ in $n!$ corresponds to a terminal $0$ in one of the factors in $n!$, and as we multiply the factors in increasing order, each such $0$ occurs after the digit at which it occurs has cycled through the values $1$ to $p-1$ exactly once while being the last non-zero digit. Since $(p-1)!=-1\bmod p$, this gives a factor $(-1)^{\epsilon_p(n)}$. But then at the end each digit also goes through a part of the cycle until it reaches its final value, again taking each value once while being the last non-zero digit. That yields a contribution $a_i!$ from each digit $a_i$.