Post Reply 
50g Mini-Challenge: Number of positive divisors of x!
09-30-2017, 09:52 PM
Post: #12
RE: 50g Mini-Challenge: Number of positive divisors of x!
So for now I wrote my own in URPL, 15 takes 1.7614 seconds, 100 needs 15,2s and 320 nearly 75 seconds. seems I need to improve my code a bit
Code:
 %%HP: T(3)A(R)F(.);
\<< 1 OVER NDUPN \->LIST \-> L
  \<< 2
    FOR K K FACTORS REVLIST OBJ\-> 2 / 1 SWAP
      START L OVER GET ROT + L UNROT PUT 'L' STO
      NEXT -1
    STEP L DUP \PILIST
  \>>
\>>
moving the list to memory and back is the main slowdown I think.
Arno
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! - Arno K - 09-30-2017 09:52 PM



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