Post Reply 
RPL exercise - Last Digits of Primes (HP 49G, G+, 50g)
06-01-2019, 12:42 PM (This post was last modified: 06-01-2019 12:57 PM by Albert Chan.)
Post: #8
RE: RPL exercise - Last Digits of Primes (HP 49G, G+, 50g)
(06-01-2019 05:29 AM)Gilles Wrote:  for 10'000, I get { 2485 2515 2500 2492 } in 0.97sec
for 100'000, I get { 24968 25008 25015 25000 } in 80.11 sec (and 0.76s on the simulator)

Hi, Gilles

Since OP started with "first" prime of 7, prime last digits must be 1,3,7,9
In other words, sum of the distributions must add up back to number of primes.

We can even optimize the code by counting only 1,3,7's, and derive count of 9's

For 10,000: 1,3,7,9's should be {2485 2515 2508 2492}
For 100,000: 1,3,7,9's should be {24968 25008 25015 25009}
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) - Albert Chan - 06-01-2019 12:42 PM



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