REW

What Is The Number Of Zeros Standing At The End Of 125?

Published Aug 29, 2025 3 min read
On this page

The number of zeros at the end of the integer 125 is zero. This is a simple observation based on the decimal representation of the number itself. The final digit is 5, not 0. A trailing zero only occurs if a number is a multiple of 10.

However, if the question actually refers to the number of zeros at the end of 125! (125 factorial), the answer is 31. This is a common and more complex mathematical problem, as it requires understanding the properties of factorials.

The number of trailing zeros in a factorial

A "trailing zero" in a number refers to a sequence of zeros at the end of the number, after which there are no more digits. For a number like a factorial, trailing zeros are created by pairs of the prime factors 2 and 5. This is because 2Γ—5=102 cross 5 equals 10

2Γ—5=10

, and each factor of 10 adds one trailing zero.

To find the number of trailing zeros in a factorial, you must count how many pairs of 2 and 5 can be formed by the prime factors of the numbers from 1 up to the given number. In any factorial, the prime factor 2 appears more often than the prime factor 5. This means the number of trailing zeros is limited by the number of fives. Therefore, the problem simplifies to counting the total number of times 5 appears as a prime factor in the factorial.

Legendre's formula

The most efficient way to calculate this is using Legendre's formula, which states that the exponent of a prime pp

𝑝

in the prime factorization of n!n exclamation mark

𝑛!

is:Ep(n!)=βˆ‘i=1∞⌊npiβŒ‹cap E sub p open paren n exclamation mark close paren equals sum from i equals 1 to infinity of the floor of the fraction with numerator n and denominator p to the i-th power end-fraction end-floor

𝐸𝑝(𝑛!)=βˆžπ‘–=1𝑛𝑝𝑖

For the number of trailing zeros, we are concerned with the number of factors of 5. So, for 125!, the formula becomes:E5(125!)=⌊1255βŒ‹+⌊12525βŒ‹+⌊125125βŒ‹+⌊125625βŒ‹+...cap E sub 5 open paren 125 exclamation mark close paren equals the floor of 125 over 5 end-fraction end-floor plus the floor of 125 over 25 end-fraction end-floor plus the floor of 125 over 125 end-fraction end-floor plus the floor of 125 over 625 end-fraction end-floor plus point point point

𝐸5(125!)=1255+12525+125125+125625+...

The division continues as long as the denominator is less than or equal to the numerator. The term ⌊125625βŒ‹the floor of 125 over 625 end-fraction end-floor

125625

is 0, so we can stop there.

Calculation for 125!

  • **First term (⌊1255βŒ‹the floor of 125 over 5 end-fraction end-floor

    1255

    )**:

    • This counts all the multiples of 5 within the factorial, from 5, 10, 15, ..., to 125.

    • 125Γ·5=25125 divided by 5 equals 25

      125Γ·5=25

    • So, we have at least 25 factors of 5.

  • **Second term (⌊12525βŒ‹the floor of 125 over 25 end-fraction end-floor

    12525

    )**:

    • This counts the extra factors of 5 from multiples of 25=5225 equals 5 squared

      25=52

      . Numbers like 25, 50, 75, and 100 contain an extra factor of 5 that was not counted in the first term.

    • 125Γ·25=5125 divided by 25 equals 5

      125Γ·25=5

    • This gives us 5 additional factors of 5.

  • **Third term (⌊125125βŒ‹the floor of 125 over 125 end-fraction end-floor

    125125

    )**:

    • This counts the additional factor of 5 from the multiple of 125=53125 equals 5 cubed

      125=53

      . The number 125 contributes a third factor of 5.

    • 125Γ·125=1125 divided by 125 equals 1

      125Γ·125=1

    • This adds one more factor of 5.

  • Summing the results:

    • 25+5+1=3125 plus 5 plus 1 equals 31

      25+5+1=31

Therefore, there are 31 trailing zeros at the end of 125!.

Common mistakes and points of clarification

  • Confusing the integer with the factorial: The most common error is to mistake the integer 125 for its factorial, 125!. The integer 125 has no trailing zeros, while its factorial has many.
  • Forgetting about higher powers of 5: When calculating the number of factors of 5, it's easy to just count the multiples of 5 and forget about multiples of 25, 125, etc. Legendre's formula correctly handles these higher powers by including multiple terms in the sum.
  • The role of 2s: While pairs of 2s and 5s are necessary for trailing zeros, the number of 2s in any factorial is always greater than or equal to the number of 5s. This is because there are more even numbers than multiples of 5. So, counting only the factors of 5 is sufficient.
Enjoyed this article? Share it with a friend.