Cody Problem 44068 asked us to count the trailing zeros in a factorial. This problem deals with the primorial. If p_n is the nth prime number, then the primorial p_n# is the product of the prime numbers up to and including p_n. For example, if n = 5, then p_5# = 2*3*5*7*11 = 2310, which has one trailing zero.
Count the trailing zeros in the primorial p_n#. Because primorials become large quickly, for large n it helps to derive a formula for the number of trailing zeros.*
Please make your code general because I might add more tests later.
*;-)

Solution Stats

148 Solutions

83 Solvers

Last Solution submitted on Dec 09, 2025

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers83

Suggested Problems

More from this Author321

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!