Post Reply 
(35S) Fermat's Factorization Programme
05-30-2014, 06:31 PM (This post was last modified: 06-15-2017 01:26 PM by Gene.)
Post: #1
(35S) Fermat's Factorization Programme
For input of a positive composite odd number the programme returns a factor. Fermat's method seeks to find two squares differing by the input as
n= x^2-y^2=(x+y)(x-y) & hey presto, two factors have been found.

1 LBL X
2 STO A
3 SQRTx
4 IP
5 2*REGX+1►X
6 SGN
7 STO Y
8 R↓
9 x^2
10 RCL- A
11 x=0?
12 GTO X024
13 RCL+ X
14 2
15 STO+ X
16 R↓
17 RCL- Y
18 2
19 STO+ Y
20 R↓
21 x>0?
22 GTO X017
23 GTO X011
24 RCL X
25 RCL- Y
26 2
27 ÷
28 RTN
Find all posts by this user
Quote this message in a reply
Post Reply 




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