HP Forums
(11C) Prime Factor Finder - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (11C) Prime Factor Finder (/thread-11557.html)



(11C) Prime Factor Finder - Gamo - 10-09-2018 11:53 AM

Program to find Prime Factorization.

This routine is reasonably fast to find prime factor consider
the slow computation speed on original Voyager Series.

Procedure: f [USER] FIX 0

n [E] display first prime factor and continue with [R/S] until
Negative value of n shown indicate that it is done.

Example:

1007 = 19 x 53

1007 [E] display 19 [R/S] 53 [R/S] -1007

------------------------------------------------

18081 = 3 x 3 x 7 x7 x 41

18081 [E] display 3 [R/S] 3 [R/S] 7 [R/S] 7 [R/S] 41 [R/S] -18081

Program: Prime Factor Finder
Code:

LBL E
STO 3
STO 0
1
STO 1
2
STO 2
---------------------------
LBL 5
RCL 0
RCL 2
รท
LSTx
X>Y
GTO 6
X<>Y
INT
LSTx
X=Y
GTO 7
2
STO+1
RCL 1
STO 2
GTO 5
-------------------------------
LBL 7
RCL 2
R/S
Rv
STO 0
GTO 5
--------------------------------
LBL 6
RCL 0
R/S
RCL 3
CHS
RTN

Gamo