Post Reply 
50g Mini-Challenge: Number of positive divisors of x!
09-30-2017, 04:29 PM
Post: #8
RE: 50g Mini-Challenge: Number of positive divisors of x!
Thank you, Thomas.

Here a SysRPL programme following Thomas' suggestion which correctly processes 100 in

0.5604s

a definite improvement on my first attempt.

Size: 147.0000

CkSum: # FDBAh

Code:
::
  CK1&Dispatch
  # FF
  ::
    ZINT 1
    SWAP
    ZINT 0
    BEGIN
    FPTR2 ^Prime+
    2DUP
    Z>=
    WHILE
    ::
      2DUP
      ZINT 0
      OVER
      2SWAP
      BEGIN
      2DUP
      FPTR2 ^ZQUOText
      DUP
      ZINT 0
      Z>
      WHILE
      ::
        5ROLL
        FPTR2 ^RADDext
        4UNROLL
        3PICK
        FPTR2 ^RMULText
      ;
      REPEAT
      4DROP
      ZINT 1
      FPTR2 ^RADDext
      4ROLL
      FPTR2 ^RMULText
      3UNROLL
    ;
    REPEAT
    2DROP
  ;
;
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: 50g Mini-Challenge: Number of positive divisors of x! - Gerald H - 09-30-2017 04:29 PM



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