Zeros of a factorial
transcript
How many zeros end a hundred thirty factorial? You cannot build the number. Count the fives instead. The number has hundreds of digits, and you only need its end.
A zero is a factor of ten. Ten is five times two. Twos are plentiful, so fives decide. So count the fives, and ignore everything else about the number.
A hundred thirty divided by five is twenty-six. Divide again: five multiples of twenty-five. Divide again: one multiple of a hundred twenty-five. Each layer counts the multiples of the next power of five.
Add the layers: twenty-six, five and one. The total is thirty-two zeros. At a size of ten to the twelve, that is eighteen divisions. No number is ever built, and every step is exact.
A common slip is one division only. It gives twenty-six, and misses the multiples of twenty-five. Repeat the division until the value reaches zero. Test twenty-five factorial, which has six zeros, not five.
A zero needs a five. Divide until nothing is left. Full breakdown in the lecture.