4 ms·
Prime p (e.g. 5) occurs exactly k times in factors of n! . k being a sum from 1 to m of a sequence whose term is [n / p^m] ([] meaning taking inteer part) wher
by slackenerny 18y ago
Prime p (e.g. 5) occurs exactly k times in factors of n! .
k being a sum from 1 to m of a sequence whose term is [n / p^m] ([] meaning taking inteer part) where m is such that p^m =< n that is m being the integer part of logarithm base p of n.
In this example
[log5(35)] = 2
so
k = [35/5^1] + [35/5^2]
Sory for bump-posting, but I had perfectly nothing better to do.