Post Reply 
RPL exercise - Last Digits of Primes (HP 49G, G+, 50g)
06-02-2019, 04:39 PM (This post was last modified: 06-02-2019 04:49 PM by John Keith.)
Post: #18
RE: RPL exercise - Last Digits of Primes (HP 49G, G+, 50g)
Here is my (somewhat cheating) version, using two external commands. I think it is the fastest user RPL version so far, but only because it leverages David's and Werner's assembly programming.

Code:

\<< 5 # 1d # 1000d
  START NEXTPRIME DUP I\->R 10. MOD SWAP
  NEXT DROP 1000. \->LIST LSORT LRPCT EVAL SWAP \->TAG
\>>

24.3 seconds; 181 seconds for 5000.

Output for 5000:

{ 1: 1243 3: 1259 7: 1252 9: 1246 }
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: RPL exercise - Last Digits of Primes (HP 49G, G+, 50g) - John Keith - 06-02-2019 04:39 PM



User(s) browsing this thread: