thisyearboom
Why are we finding largest power of 5 in 100! ? Shouldn't we be finding largest power of 10 in 100! which would be 11 ?
Trailing zeros refer to a sequence of 0's in a decimal representation of a number, after which no other digits are present.
For instance, 125,000 has 3 trailing zeros.
The number of trailing zeros in the factorial of a non-negative integer, \(n!\), can be determined using this formula:
\(\frac{n}{5}+\frac{n}{5^2}+\frac{n}{5^3}+...+\frac{n}{5^k}\), where \(k\) must be selected such that \( 5^k \leq n\)
Let's consider an example:
How many zeros are at the end of 32!?
\(\frac{32}{5}+\frac{32}{5^2}=6+1=7\). Observe that the last denominator (\(5^2\)) must be less than 32. Also, note that we only consider the quotient of the division, that is \(\frac{32}{5}=6\).
So, there are 7 zeros at the end of 32!.
Another example: how many trailing zeros does 125! have?
\(\frac{125}{5}+\frac{125}{5^2}+\frac{125}{5^3}=25+5+1=31\),
The formula essentially counts the number of factors of 5 in n!, but since there are at least as many factors of 2, this is equivalent to counting the number of factors of 10, each of which contributes one more trailing zero.