Message #1 Posted by Gerry Schultz (Los Angeles) on 25 Oct 2006, 3:16 p.m.
Ever since I was in high school, I've always been facinated with prime numbers and computers. In a math class there was a desktop computer that could be programmed with punch cards (around 1971). I don't remember the make of the computer but a classmate programmed the computer to print out prime numbers. I made a copy of his punch cards and between the two of us filled the walls of the classroom with printouts of prime numbers over the next few months. Looking back, our teacher was amused and very patient with our after school activity of printing out prime numbers cluttering the walls of his classroom and destroying trees.
I never understood the program my classmate wrote but when I got my first programmable calculator, an HP-55 which I still own and works well, the first program I ever wrote on it was how to generate a list of prime numbers.
The program was slow and had no printout, but it forced me to try and program. My little program worked but not very well, and since the 55 is so limited in programming, I didn't continue with this passion until I got an HP-41C.
With the HP-41C, a card reader and a printer, I started trying to modify my program to print out prime numbers on my 41C. Again, my program worked but it was slow and took a long time to print out prime numbers and was nothing like the desktop computer back in high school.
As A member of the PPC, I purchesed back issues of the PPC Journal and on page 31 of V7 N1, there was what I was looking for. An article about Faster Primes by Walter Castles with a 41C program listing on page 32. I put it in immediately and was astounded at how fast it was. I tried every way I could think of to analyze and understand Walter's program without success.
(As a side note, I recently loaded this program into a 41 PC emulator and it ran like the wind until it crashed because data registers above 99 can't be accessed directly. I've always wondered why. I assume it was never designed to calculate prime numbers that large.)
I gave up on it until I got a 48GX and tried to figure out how to translate this program into RPL. I was not able to figure out how to do it and felt very frustrated.
I have since purchased a 49G, a 49g+ and a 50G and this has motivated me to once again try again to translate this 41C program to RPL.
To minimize my frustration, I will begain by admitting defeat in trying to understand how this program works. It's only 66 steps long but it's a puzzle to me. If anyone who has read this story has some insights on how this proggram works I would be grateful. I would like to put this little fetish to rest until the next generation of calculators comes out.
Thanks for reading,