Hi all,
Is there a general way to find out how many zeros there are at the end of some product like or ?
I know the examples I gave are easy. But for harder problems like the number of zeros at the end of , is there a proper way?
Help would be appreciated. After all, I'm still 13 :P
Easy Math Editor
This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.
When posting on Brilliant:
*italics*
or_italics_
**bold**
or__bold__
paragraph 1
paragraph 2
[example link](https://brilliant.org)
> This is a quote
\(
...\)
or\[
...\]
to ensure proper formatting.2 \times 3
2^{34}
a_{i-1}
\frac{2}{3}
\sqrt{2}
\sum_{i=1}^3
\sin \theta
\boxed{123}
Comments
To find the number of zeros at the end of a product, we need to find the minimum of the exponent of 5 and 2, since a number abcdef0000 is equal to abcdef×10000=abcdef×104=abcdef=×24×54. Note abcdef can contain a factor of 2 or 5 but not both, or else it would end in 0. So the number of zeros in a number is the minimum of the exponents of 5 and 2.
So in 212×510×327 the number of trailing zeroes is min(12,10)=10.
In products like n!, it is easy to see that the exponent of 5 will be less than the exponent of 2.So we just need to find the exponent of 5. To find the exponent of 5 in n!, you can use Legendre's formula
Log in to reply
Basically, do you mean the magnitude to which the power of 5 is raised?
Log in to reply
Yes.
For factorials, the general formula for how many zeros there are is practically asking what is the highest power of 5 which divides n!(because the largest power of 2 that divides n! is bigger).The formula is
i=1∑∞⌊5in⌋. At some point, the 5i 's will get bigger than n, so the sum is finite.
The reason that the formula works is that you are doing this: first you count the numbers less than or equal to n that are divisible by 5.But then you would have missed the extra powers from the ones that are divisible by 25 etc.
The formula works for any prime p, not just for 5. It is an easy way to figure out the prime factorization of n! without actually calculating it.
For instance, the highest power of 10 that divides 50! is
10+2+0+0...=12