Post Reply 
(30b) Fermat's Factorization Prog
11-02-2014, 01:48 PM (This post was last modified: 06-15-2017 01:24 PM by Gene.)
Post: #1
(30b) Fermat's Factorization Prog
Fermat’s factorization finds the largest factor less or equal to the square root of integer input:

0 P6
1 Input
2 Input
3 STO 1
4 √
5 Math
6 Up
7 Up
8 Input
9 Input
10 2
11 *
12 1
13 STO 2
14 +
15 STO 3
16 R↓
17 X^2
18 Swap
19 -
20 STO 4
21 Lbl 10
22 RCL 4
23 GT 11
24 RCL 2
25 STO- 3
26 2
27 STO/ 3
28 RCL 1
29 RCL 3
30 RTN
31 Lbl 11
32 RCL 3
33 STO+ 4
34 2
35 STO+ 3
36 Lbl 12
37 RCL 2
38 STO- 4
39 2
40 STO+ 2
41 RCL 4
42 0
43 ?>
44 GT 12
45 Gto 10

Improvement suggestions welcome.
Find all posts by this user
Quote this message in a reply
Post Reply 




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