Factorials
Factorials
Trailing zeroes in n!:
floor(n/5) + floor(n/25) + floor(n/125) + ...
Highest power of prime p in n!:
floor(n/p) + floor(n/p^2) + floor(n/p^3) + ...
Last non-zero digit and advanced factorial remainders are lower frequency; use only if the question clearly asks.