# last non-zero digit of factorial

We will show how to compute the last non-zero digit of the factorial of a number from its digits without having to compute the factorial itself.

Let $L(n)$ denote the last non-zero digit of $n$ in base 10. We note some basic properties of $L$ which can easily be checked:

• For all $n$, we have $L(10n)=L(n)$.

• If $L(m)\neq 5$ and $L(n)\neq 5$, then $L(mn)=L(L(m)L(n))$.

We also tabulate the values of $L(n!)$ for small values of $n$:

 $\displaystyle L(0!)$ $\displaystyle=$ $\displaystyle 1$ $\displaystyle L(1!)$ $\displaystyle=$ $\displaystyle 1$ $\displaystyle L(2!)$ $\displaystyle=$ $\displaystyle 2$ $\displaystyle L(3!)$ $\displaystyle=$ $\displaystyle 6$ $\displaystyle L(4!)$ $\displaystyle=$ $\displaystyle 4$ $\displaystyle L(5!)$ $\displaystyle=$ $\displaystyle 2$ $\displaystyle L(6!)$ $\displaystyle=$ $\displaystyle 2$ $\displaystyle L(7!)$ $\displaystyle=$ $\displaystyle 4$ $\displaystyle L(8!)$ $\displaystyle=$ $\displaystyle 2$ $\displaystyle L(9!)$ $\displaystyle=$ $\displaystyle 8$ $\displaystyle L(10!)$ $\displaystyle=$ $\displaystyle 8$

Next, we make two less trivial observations:

{theorem}

For all positive integers $n$, we have $L(n!)\neq 5$.

Title last non-zero digit of factorial LastNonzeroDigitOfFactorial 2013-03-24 0:23:36 2013-03-24 0:23:36 rspuzio (6075) rspuzio (6075) 4 rspuzio (6075) Definition