From: "David Wilson" Subject: Manual method for computing A008904(n) Date: Wed, 19 May 2010 17:58:07 -0400 A method for computing the last nonzero digit of n! = A008904(n) If n = 0 or 1, then A008904(n) = 1. For n >= 2, do as in this example with n = 1492. 1) Convert n to base 5 21432 2) Multiply each digit of (1) by its place, and sum the result 2*4 + 1*3 + 4*2 + 3*1 + 2*0 = 22 3) Compute half the sum of just the even digits of (1) (2 + 4 + 2)/2 = 4 4) Sum (2) and (3) 22 + 4 = 26 5) Compute remainder mod 4 26 mod 4 = 2 6) Compute power of 2 2^2 = 4 7) If result is 1, change it to 6. 4 So the last nonzero digit of 1492! is 4.