HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Problems
  2. /A calculator shows only the first digits of a huge factorial, but you can still count the zeros at…
HardMathematicsHigh School (11–12)Number TheoryNumericalOlympiad

A calculator shows only the first digits of a huge factorial, but you can still count the zeros at…

StemPy LabContributed by StemPy Lab

Try it on paper first. A hint, the key idea and the worked solution are here when you need them.

A calculator shows only the first digits of a huge factorial, but you can still count the zeros at its end.

  1. How many zeros are at the end of 350!350!350!?
  1. How many zeros are at the end of 1000!1000!1000!?
  1. Find the smallest nnn for which n!n!n! ends in exactly 100100100 zeros.
  1. Explain why no factorial ends in exactly 555 zeros.

Check your answer

Work it out on paper, then type your number. The answer itself stays hidden.

Need a reminder? The key ideaShowHide

⌊x⌋≤x<⌊x⌋+1\lfloor x \rfloor \le x < \lfloor x \rfloor + 1⌊x⌋≤x<⌊x⌋+1. From 111 to nnn there are ⌊n/d⌋\lfloor n/d \rfloor⌊n/d⌋ multiples of ddd. Legendre: the exponent of a prime ppp in n!n!n! is ⌊n/p⌋+⌊n/p2⌋+…\lfloor n/p \rfloor + \lfloor n/p^2 \rfloor + \dots⌊n/p⌋+⌊n/p2⌋+…

The worked solution

Check an answer or open a hint to unlock the worked solution.

Have you tried it?

Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.

Plan. The number of zeros is the exponent of 555 in n!n!n!, because the factors 222 are more plentiful.

Step 1. Part (a). ⌊350/5⌋+⌊350/52⌋+⌊350/53⌋=70+14+2=86\lfloor 350/5 \rfloor + \lfloor 350/5^2 \rfloor + \lfloor 350/5^3 \rfloor = 70 + 14 + 2 = 86⌊350/5⌋+⌊350/52⌋+⌊350/53⌋=70+14+2=86.

Step 2. Part (b). The terms are ⌊1000/5⌋\lfloor 1000/5 \rfloor⌊1000/5⌋, ⌊1000/52⌋\lfloor 1000/5^2 \rfloor⌊1000/52⌋, ⌊1000/53⌋\lfloor 1000/5^3 \rfloor⌊1000/53⌋ and ⌊1000/54⌋\lfloor 1000/5^4 \rfloor⌊1000/54⌋, which add up to 249249249.

Step 3. Part (c). For n=404n = 404n=404: 80+16+3=9980 + 16 + 3 = 9980+16+3=99. The count is 999999 from the previous multiple of 555 up to n=404n = 404n=404 and changes only at the next multiple of 555. For n=405n = 405n=405: 81+16+3=10081 + 16 + 3 = 10081+16+3=100. So the smallest nnn is 405405405.

Step 4. Part (d). 24!24!24! has 4+0=44 + 0 = 44+0=4 zeros and 25!25!25! has 5+1=65 + 1 = 65+1=6. The count jumps from 444 to 666 at 252525, so 555 is skipped.

Answer: 868686 zeros, 249249249 zeros, and n=405n = 405n=405; the count 555 is skipped at 25!25!25!.

Log in to save this for later
← All Problems
← A number is perfect when σ(n) = 2n. Prove that if 2ᵖ - 1 is prime, then 2ᵖ⁻¹(2ᵖ - 1) is perfect…The number (100, 50) = (100!)/(50! 50!) has 30 digits… →
More onNumber Theory

Discussion (0)

Log in to join the discussion.

Loading…

More on this topic

  1. The triangular numbers are 1, 3, 6, 10, …, where the nth one is (n(n + 1))/2…Advanced
  2. Prove that the equation x³ + y³ + z³ = n has no solution in integers when n leaves remainder 4 or 5…Advanced
  3. Find every triple of positive integers a ≤ b ≤ c with 1/a + 1/b + 1/c = 1, and prove that there are…Advanced
  4. Find all pairs of positive integers (x, y) with x² - y² = 945…Hard
  5. A teacher wants a list of every primitive Pythagorean triple whose hypotenuse is less than 100…Advanced
All problems on this topic →