If you can understand the concept of “skipping trailing zeroes” or understand the pattern of how consecutive factorials after 5! work in regards to trailing zeroes, the problem is not that difficult.
However, most of us don’t know the concept so this is good practice at finding patterns.
Every prime factor pair of (5 *2) included within a Factorial’s prime factorization will produce 1 trailing zero.
There will always be more 2 prime factors than 5 prime factors past 5!
Thus, finding the Count of 5 prime factors in the factorial is enough to determine the number of trailing zeroes (there will always be a 2 prime to pair with the 5)
From 5! - to - 9!——-> we will only have 1 prime factor of 5 ———> only 1 trailing zero
Once we hit 10! ———> since there are now 2 prime factors of 5 ———> 2 trailing zeroes
2 trailing zeroes will continue through 14! until we hit the next multiple of 5 ——> 15! ——> which will have 3 trailing zeroes
Following this pattern:
15! - 19! ——— 3 TZ
20 - 24! ———- 4 TZ
However , when we hit a multiple of (5)^2 = 25 ———> we will “skip a trailing zero” because the added factor of 25 is now adding 2 more trailing zeroes than 24! had
25! - 29! ——- 6 TZ (not 5 TZ)
Thus, in order to “skip 2 trailing zeroes” and go from X tz ——- skip over (X + 1) and (X + 2)——- and go to (X + 3) tz
n + 1 must be a multiple of (5)^3 = 125
124! ——> will have X trailing zeroes
Now when we go to 125! ——-> a factor of (5)^3 has been added to the product chain——> there will be (X + 3) trailing zeroes
Basically, we need to find the multiples of 125 up through 1,000 with one important caveat:
n = 124! ———n + 1 = 125!
250!
375!
500!
***625!***
750!
875!
1,000!
We have 8 times that consecutive factorials will skip more than 2 trailing zeroes.
However, since 625 = (5)^4
624! ——-> will have X trailing zeroes
625! ———> will add FOUR more prime factors of 5, and thus FOUR more trailing zeroes ——-> (X + 4) trailing zeroes
Removing 625! = (n + 1)!
There are 7 numbers of N
B
Posted from my mobile device