Post Reply 
(19C) Prime numbers up to 10'000
02-27-2018, 05:32 PM
Post: #4
RE: (19C) Prime numbers up to 10'000
(02-26-2018 04:43 AM)Gerson W. Barbosa Wrote:  
Quote:Unfortunately, the paper ran out ... ... at about 9’300.

The expected number of primes less than 10000 is about

10000/(ln(10000) - 1) ~ 1218,

which would require at least 3.10 meters of paper on the 82240B IR printer (apparently 1/10 inches per line).

I have to admit I did not prepare well enough. However, bad luck was also part of the game: in the first run there was a paper jam after a few hundreds of numbers. I took the bad decision to rerun the program without installing a fresh paper roll :-(

Quote:HP 50g program:

« 1
DO NEXTPRIME PR1 DUPDUP
UNTIL 9997 >
END
»

Impressively short and elegant (and of course way faster), however, there are nearly 30 years between the introduction of the 19C and 50g.

Quote:Notice 1 is not prime.

True, and that's a minor error in the 19C program from the BYTE magazine. I just didn't want to change it and run the original program.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (19C) Prime numbers up to 10'000 - Jurgen Keller - 02-27-2018 05:32 PM



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