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$)?

  • 1
    $\begingroup$ geeksforgeeks.org/last-non-zero-digit-factorial $\endgroup$ – vadim123 Jan 28 at 17:33
  • $\begingroup$ Note that you get $k$ additional zeros every $a5^k$ terms where $a \in \mathbb Z^+$. $\endgroup$ – Mohammad Zuhair Khan Jan 28 at 17:37
  • $\begingroup$ 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$). $\endgroup$ – gandalf61 Jan 28 at 17:39
  • 1
    $\begingroup$ This is A008904. $\endgroup$ – lulu Jan 28 at 18:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.