HP Forums

Full Version: (12C Platinum) Prime Factors Finder
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This Prime Factor program is adapted from

Sinclair Cambridge Programmable
Mathematics Program Library on Page 23.6

To work on HP-12C Platinum with ALG mode

——————————————————————-
Example: FIX 0

537

537 [R/S] 3 [R/S] 179 [R/S] 1

Answer: Prime factor of 537 is 3 and 179
——————————————————————
91991

91991 [R/S] 67 [R/S] 1373 [R/S] 1

Answer: Prime factor of 91991 is 67 and 1373
———————————————————————

Program: 12C Platinum ALG mode
Quote:[STO] 0 ÷ 2 = [INTG]
[STO] 1
[STO] 2
1 [STO] 3
[RCL] 0 - [RCL] 2 =
1 [CHS] [X<>Y] [X≤Y] [GTO] 038
[CHS] 1 [CHS] [X<>Y] [X≤Y] [GTO] 045
[RCL] 1 - 2 =
1 [CHS] [X<>Y] [X≤Y] [GTO] 050
[RCL] 3 [R/S] [RCL] 1 [GTO] 001
1 [CHS] [STO]+1 [RCL] 3 [CHS] [STO]+2 [GTO] 010
1 [STO]+3 [RCL] 1 [STO]+2 [GTO] 010
[RCL] 3 [R/S] 1

Remark:
With this Algorithm the computation speed is slow on physical 12C Platinum where
The emulators will run much faster.

Gamo
Reference URL's