Post Reply 
RPL mini-challenge - Triangle of Primes (HP-49G/G+,50g)
07-01-2019, 12:49 PM (This post was last modified: 07-01-2019 01:05 PM by John Keith.)
Post: #9
RE: RPL mini-challenge - Triangle of Primes (HP-49G/G+,50g)
My simplistic RPL solution. 83 bytes, checksum # EBAAh. Optimized for speed rather than size. An input of 9 takes 1.19 seconds on my HP 50. An input of 99 takes 397 seconds, or 6.98 seconds on EMU48. The HP Prime could solve this almost instantly as the Prime has the 'ithprime' function.

Code:

*Spoiler alert*
















\<< I\->R \-> n
  \<< 2 2. n 2. *
    FOR k DUP 1. k
      START NEXTPRIME
      NEXT 2.
    STEP n 1. + \->LIST
  \>>
\>>
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: RPL mini-challenge - Triangle of Primes (HP-49G/G+,50g) - John Keith - 07-01-2019 12:49 PM



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