It is based on the concept of Highest Power in Factorial. Look here:
https://anaprep.com/number-properties-h ... actorials/A trailing zero (0 at the end of a number) is obtained when the number has 10 as a factor. A 10 needs a 2 and a 5. There are typically enough 2s but fewer 5s in factorials so number of 5s in a factorial give us the number of trailing zeroes.
5! has 1 trailing zero because it has exactly one 5 in it.
6! has 1 trailing zero because it has exactly one 5 in it.
...
9! has 1 trailing zero because it has exactly one 5 in it.
10! has 2 trailing zeroes because it has 2 5s in it.
24! has 4 trailing zeroes because it has 4 5s in it.
25! has 6 trailing zeroes because it has 6 5s in it. (25 brings in 2 extra 5s)
There is no number which has 5 trailing zeroes.
The question asks for the smallest number n such that no positive integer factorial has n trailing zeroes, or n + 1 trailing zeroes or n + 2 trailing zeroes.
So a number that introduces 4 5s will be required. That smallest number is 625 (which brings in 4 5s)
So 624! has 152 5s in it. 625! will have 156 5s in it.
So no factorial has 153, 154 and 155 5s in it. No factorial has n, n+1 and n+2 5s)
rak08