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$)?
Asked
Active
Viewed 47 times
1
-
1https://www.geeksforgeeks.org/last-non-zero-digit-factorial/ – vadim123 Jan 28 '19 at 17:33
-
Note that you get $k$ additional zeros every $a5^k$ terms where $a \in \mathbb Z^+$. – For the love of maths Jan 28 '19 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 '19 at 17:39
-
1This is A008904. – lulu Jan 28 '19 at 18:03