Post Reply 
(50g) OEIS A008904: Last Non-Zero Digit of Factorial
09-11-2017, 08:54 PM
Post: #2
RE: (50g) OEIS A008904: Last Non-Zero Digit of Factorial
Here a smaller & much faster version of the programme:

Size: 185.5

CkSum: # E8F9h

Code:
::
  CK1&Dispatch
  # FF
  ::
    '
    ::
      DUP
      ZINT 2
      Z<
      casedrop
      BINT1
      {
        BINT6
        BINT6
        BINT12
        BINT36
        BINT24
        BINT24
        BINT24
        BINT48
        BINT24
        BINT36
      }
      OVER
      ZINT 10
      FPTR2 ^ZMod
      FPTR2 ^Z2BIN
      #1+
      NTHCOMPDROP
      {
        BINT1
        BINT3
        BINT9
        BINT27
      }
      ROT
      ZINT 5
      FPTR2 ^ZQUOText
      DUP4UNROLL
      ZINT 4
      FPTR2 ^ZMod
      FPTR2 ^Z2BIN
      #1+
      NTHCOMPDROP
      #*
      SWAP
      1GETLAM
      EVAL
      #*
      BINT10
      #/
      DROP
    ;
    DUP1LAMBIND
    EVAL
    ABND
    FPTR2 ^#>Z
  ;
;
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-11-2017 08:54 PM



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