Problems > Prime Power in a Factorial > Editorial

Prime Power in a Factorial — Solution & Editorial

Back to the Problem

Legendre's formula: ∑k≥1 ⌊N / Pk⌋, summed until Pk exceeds N.

Complexity: O(logP N)