Re: Challenge (also my HP41 PRGM for primes) Message #17 Posted by Vieira, Luiz C. (Brazil) on 11 Mar 2003, 8:08 a.m., in response to message #16 by hugh
Hi;
I do not know the process of detecting pseudoprimes, instead I heard about it when I was at the university as a solution for the prime chain and mathgrade students used to play many algorithms and methods for this subject. Even being an engineer guy, I always liked teasing math and algebraic problems (at least before buying an HP41C, when I developed a pasion for program development in portable devices), but I never found the time for studying them.
Is it easy to find eliterature at the www about this pseudoprimes detection? I remember reading briefly about obtaining new primes by adding groups of 2, 3 and 5, but I never got any paper that explained this subject in deep.
Thanks for the valuable explanation, Hugh.
Best regards.
Luiz C. Vieira  Brazil
(in time: my classical trialdivision routine for the HP41 is listed below.
01 LBL "P"
02 RUNSW
03 SF 25
04 SF 10
05 1.001
06 STO 00
07 3
08 STO 01
09 LBL 08
10 FC?C 10
11 GTO 07
12 ENTER^
13 ENTER^
14 ENTER^
15 RCL IND 00
16 MOD
17 X=0?
18 SF 10
19 X<>Y
20 ISG 00
21 GTO 08
22 STO IND 00
23 FC? 25
24 STOPSW
25 FC? 25
26 OFF
27 RCL 00
28 INT
29 1 E3
30 /
31 GTO 06
32 LBL 07
33 RCL 00
34 FRC
35 LBL 06
36 1
37 +
38 STO 00
39 RDN
40 2
41 +
42 GTO 08
I'm 100% sure I improved it so I used only stack registers, but I cannot find the d*m listing. This is the CX version and you need to clear the stopwatch before starting it. After the last register is used, the program stops the stopwatch and switches calculator to OFF. If you wnat to use it in an HP41C or CV, simply remove lines 03 RUNSW, 23 FC?25 and 24 STOPSW.)
