# The last digit of $n!$ for $n \ge 5$ is always $0$. What are the options for the last non-zero digit of $n!, n\ge 5$?

I've found formulas online that use the greatest integer function, but they seem to answer my question for specific values of $$n$$. Is there an easier approach to find all values the last non-zero digit of a random $$n$$ can take? Is there another way to find these values (so not necessarily using the formulas with $$\left\lfloor\cdots\right\rfloor$$)?

• geeksforgeeks.org/last-non-zero-digit-factorial – vadim123 Jan 28 at 17:33
• Note that you get $k$ additional zeros every $a5^k$ terms where $a \in \mathbb Z^+$. – Mohammad Zuhair Khan Jan 28 at 17:37
• For $n>1$ the last non-zero digit of $n!$ has to be even since the exponent of $2$ in the prime expansion of $n!$ is greater than the exponent of $5$ (i.e. in $\{1,2,\dots,n\}$ there are more even numbers than multiples of $5$). – gandalf61 Jan 28 at 17:39
• This is A008904. – lulu Jan 28 at 18:03