Suppose we want to find how many factors of $7$ is in $500!$.
We want to find number of factors of $7$ in $N = 500 \cdot 499 \cdot ... \cdot 7 \cdot ... \cdot 2 \cdot 1.$ Of course, we can eliminate all factors which are not dividible by $7$, for example $500, 499, 498$. Knowing property of multiplication we infact must find how many seven's are in the list $\{7 \cdot 1, 7 \cdot 2, ..., 7 \cdot 71\}.$ Obviously $71$ for the first hand. After that, we are finding number of seven's in the $\{7 \cdot 1, ..., 7 \cdot 10\}.$ Obviously there are $10$ seven's in it for the second hand. Finally we got number of seven's from $1$ to $10$ which is $1$.
The total number is $71 + 10 + 1= 82.$
Therefore, $N = k \cdot 7^{82},$ where $k > 1$ is not divisible by $7.$
More simply, $\lfloor\frac{500}{7}\rfloor + \lfloor\frac{500}{7^2}\rfloor + \lfloor\frac{500}{7^3}\rfloor = 82,$ and simillary for any case.
I don't remember how is this formula called. (I think it's named after some French mathematician.) Please help me with this.