Post Reply 
(38G) OEIS A008904: Last Non-Zero Digit of Factorial
09-11-2017, 03:54 PM (This post was last modified: 09-11-2017 04:16 PM by Gerald H.)
Post: #2
RE: (38G) OEIS A008904: Last Non-Zero Digit of Factorial
A slightly improved version of the programme:

Code:
RECURSE(U,IFTE(N<6,IFTE(N==3,2,IFTE(N==4,6,4)),IFTE(U3(N)<2,6,IFTE(U3(N)==2,12,IFTE(U3(N)==3,36,IFTE(U3(N)==7,48,IFTE(U3(N)==9,36,24)))​))*3^(U2(N) MOD 4)*U1(U2(N)+1)) MOD 10,1,1)►U1(N):
CHECK 1:
RECURSE(U,INT((N-1)/5),0,0)►U2(N):
RECURSE(U,(N-1) MOD 10,0,1)►U3(N):
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (38G) OEIS A008904: Last Non-Zero Digit of Factorial - Gerald H - 09-11-2017 03:54 PM



User(s) browsing this thread: 1 Guest(s)