Re: prime factorization


[Prev][Next][Index][Thread]

Re: prime factorization



Yeah, If memory serves me, in the "samples" or "freeware" directory of
the link software, there is a program (Factor maybe?) that takes a
number, amd factors it using lists, then displays the results.  I should
have the code lying around on disk, or else it should be at Ticalc.org.
I HAVE FOUND THE CODE!!! SEE BOTTOM OF THIS FILE FOR SOURCE
On Wed, 1 Oct 1997 18:44:44 -0700 Mark Baldi-Biek <baldi@lclark.edu>
writes:
>Anyone have any code for prime factorization of an integer?
>

\START82\
\COMMENT=Program file dated 05/26/93, 09:53
\NAME=FACTOR
\FILE=C:\TISOFT~1\82PROGS\FACTOR.82P
:0\->\dim \L1\
:Prompt N
:1\->\S
:2\->\F
:0\->\E
:\sqrt\N\->\M
:While F\<=\M
:While fPart (N/F)=0
:E+1\->\E
:N/F\->\N
:End
:If E>0:Then
:F\->\\L1\(S)
:E\->\\L1\(S+1)
:S+2\->\S
:0\->\E
:\sqrt\N\->\M
:End
:If F=2
:Then:3\->\F
:Else:F+2\->\F
:End
:End
:If N\<>\1:Then
:N\->\\L1\(S)
:1\->\\L1\(S+1)
:End
:\L1\
\STOP82\


References: