### Random Post

### Recent Posts

### Recent Comments

Hugh Casement on Enigma 1070: Time to work | |

Jim Randell on Enigma 1070: Time to work | |

Jim Randell on Enigma 1070: Time to work | |

geoffrounce on Enigma 440: Three X | |

Jim Randell on Enigma 1588: As easy as 1… |

### Archives

### Categories

- article (11)
- enigma (1,157)
- misc (2)
- project euler (2)
- puzzle (39)
- site news (44)
- tantalizer (42)
- teaser (3)

### Site Stats

- 177,568 hits

Advertisements

The number of zeros depends on the number of times 5 appears as a factor (as there are always enough 2 factors to multiply it up to 10).

This Python program counts the number of factors that are various powers of 5.

For 1000000! it calculates the result in 31ms.

Solution:The decimal representation of 1,000,000! ends in 249,998 zeros.A manual solution:

The above analysis leads to a one line Python solution :