RPL exercise - Last Digits of Primes (HP 49G, G+, 50g)
|
06-01-2019, 11:05 PM
(This post was last modified: 06-01-2019 11:06 PM by Dave Britten.)
Post: #17
|
|||
|
|||
RE: RPL exercise - Last Digits of Primes (HP 49G, G+, 50g)
I don't have my 48 handy at the moment, but here's a 42S/DM42 version. Input the number of primes greater than 5 to look for, and XEQ "PRMDGT". The number of primes ending in 1, 3, 7, and 9 will be in stack T, Z, Y, and X respectively. This uses the well-known mod 30 sieve to check for primes.
Code: 00 { 53-Byte Prgm } This finds and tallies 1000 primes in about 25 seconds on my DM42 when running in fast mode (i.e. connected to external power). |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)