Post Reply 
(50g) OEIS A008904: Last Non-Zero Digit of Factorial
09-23-2017, 03:17 PM
Post: #3
RE: (50g) OEIS A008904: Last Non-Zero Digit of Factorial
A shorter & quicker programme:

Code:
::
  CK1&Dispatch
  # FF
  ::
    DUP
    Z2_
    Z<
    casedrop
    Z1_
    Z2_
    ZEROZERO
    4ROLL
    BEGIN
    Z5_
    FPTR2 ^ZDIVext
    FPTR2 ^Z>#
    DUP
    4ROLL
    DUP#1+
    5UNROLL
    #*
    SWAP
    BINT2
    #/
    SWAP
    #0=ITE
    #+
    DROP
    4ROLL
    #+
    UNROTDUP
    Z0_
    EQUAL
    UNTIL
    2DROP
    BINT4
    #/
    DROP
    FPTR2 ^RP#
    DUP
    Z1_
    EQUALNOT
    ?SEMI
    DROP
    Z6_
  ;
;
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (50g) OEIS A008904: Last Non-Zero Digit of Factorial - Gerald H - 09-23-2017 03:17 PM



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