Post Reply 
(19C) Prime numbers up to 10'000
02-25-2018, 06:35 PM
Post: #1
(19C) Prime numbers up to 10'000
Recently I stumbled across an old BYTE article about a program for the HP-19C which computes the prime numbers up to 10'000. You'll find the article, the program and even a time lapse video in my blog article: Primzahlen mit dem HP-19C
Find all posts by this user
Quote this message in a reply
02-25-2018, 09:30 PM
Post: #2
RE: (19C) Prime numbers up to 10'000
(02-25-2018 06:35 PM)Jurgen Keller Wrote:  Recently I stumbled across an old BYTE article about a program for the HP-19C which computes the prime numbers up to 10'000. You'll find the article, the program and even a time lapse video in my blog article: Primzahlen mit dem HP-19C

Nice article Jurgen. I liked that your video showed the setup for the slo-mo photography. Who would have guessed that a rolling pin was an essential prop for hi-technology photography?

And by coincidence, that same Byte issue includes an article about "Darth Vader's Force Battle" program for the TI-59 that explains how to generate some of the TI 58/59 synthetic instructions. I recently acquired a series of old TI manuals and programs that includes the author's original program sheets for this program and a copy of the Byte article, but it was not dated so I could not locate it.

Thanks!

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
02-26-2018, 04:43 AM (This post was last modified: 02-26-2018 04:47 AM by Gerson W. Barbosa.)
Post: #3
RE: (19C) Prime numbers up to 10'000
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).

HP 50g program:

« 1
DO NEXTPRIME PR1 DUPDUP
UNTIL 9997 >
END
»

Notice 1 is not prime.

Nice video anyway.
Find all posts by this user
Quote this message in a reply
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
02-27-2018, 05:59 PM
Post: #5
RE: (19C) Prime numbers up to 10'000
(02-25-2018 09:30 PM)rprosperi Wrote:  
(02-25-2018 06:35 PM)Jurgen Keller Wrote:  Recently I stumbled across an old BYTE article about a program for the HP-19C which computes the prime numbers up to 10'000. You'll find the article, the program and even a time lapse video in my blog article: Primzahlen mit dem HP-19C
And by coincidence, that same Byte issue includes an article about "Darth Vader's Force Battle" program for the TI-59 that explains how to generate some of the TI 58/59 synthetic instructions.
Thank you for this hint, I've missed that article. There must be a TI 59 somewhere and it will be happy to get some attention!
Find all posts by this user
Quote this message in a reply
Post Reply 




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