Legendre's formula is needed in order to find out the degree of occurrence of a prime number in the factorial. Calculate the value of the degree of occurrence of the prime number p in the number n! it is possible for the asymptotics of O(log(p) n). The formula itself looks like this: $$$v(n!) = [n/p^1] + [n /p^2] + [n / p^3] + ...$$$ It is not difficult to prove that it is true.

Auto comment: topic has been translated by bobr_efim (original revision, translated revision, compare)