last nonzero digit of factorial
We will show how to compute the last nonzero digit of the factorial^{} of a number from its digits without having to compute the factorial itself.
Let $L(n)$ denote the last nonzero 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)\ne 5$ and $L(n)\ne 5$, then $L(mn)=L(L(m)L(n))$.
We also tabulate the values of $L(n!)$ for small values of $n$:
$L(0!)$  $=$  $1$  
$L(1!)$  $=$  $1$  
$L(2!)$  $=$  $2$  
$L(3!)$  $=$  $6$  
$L(4!)$  $=$  $4$  
$L(5!)$  $=$  $2$  
$L(6!)$  $=$  $2$  
$L(7!)$  $=$  $4$  
$L(8!)$  $=$  $2$  
$L(9!)$  $=$  $8$  
$L(10!)$  $=$  $8$ 
Next, we make two less trivial observations:
For all positive integers $n$, we have $L(n!)\ne 5$.
Title  last nonzero digit of factorial 

Canonical name  LastNonzeroDigitOfFactorial 
Date of creation  20130324 0:23:36 
Last modified on  20130324 0:23:36 
Owner  rspuzio (6075) 
Last modified by  rspuzio (6075) 
Numerical id  4 
Author  rspuzio (6075) 
Entry type  Definition 