[Math] Repeating last non-zero digits of factorial

elementary-number-theory

Note: This question was inspired by this projectEuler problem, but I am not looking for a way to solve it.

Why is it that the last $n$ non-zero digits do not repeat themselves in a simple fashion. After all, lets say I am looking for the last non-zero digit. I will always be multiplying by the same set of numbers in the same order, (01-99) and so I would assume that since all of these numbers will be hit once for 100!, twice for 200!, three times for 300! and four times for 400!, the last digit of these numbers would be scalar multiples of each other (mod 10) but this is not the case.

I sense that I am making a simple logical error. What is it?

Best Answer

The issue comes from not counting the "hidden" occurrences of digits in multiples of $5$, including the multiples of $10$. The digits $1$, $2$, $3$, $4$, $6$, $7$, $8$, $9$ repeat in a pleasant fashion, and if we forgot about the multiples of $5$ (including the multiples of $10$), we would get automatic periodicity. However, the $7$ that is hidden in $35$, and from the point of view of last digits, becomes $7\cdot 9$ on multiplication by $38$, is different from the $1$ that is hidden in $55$, and becomes $1\cdot 9$ on multiplication by $58$. More simply, $600$ and $700$ end in the same digit, but effectively for the last non-zero digit problem they are different.

This unfortunately does not prove that the last non-zero digits are not eventually periodic. It only shows why your reasonable first approach to showing periodicity does not work.

Related Question