From helens!shelby!rutgers!tut.cis.ohio-state.edu!uc!norge.unet.umn.edu!fin Fri May 25 01:21:31 PDT 1990
Status: RO

Article 1740 of comp.sys.handhelds:
Path: helens!shelby!rutgers!tut.cis.ohio-state.edu!uc!norge.unet.umn.edu!fin
>From: fin@norge.unet.umn.edu (Craig A. Finseth)
Newsgroups: comp.sys.handhelds
Subject: Prime Factorizer for the HP-48SX
Message-ID: <1833@uc.msc.umn.edu>
Date: 24 May 90 20:55:46 GMT
Sender: news@uc.msc.umn.edu
Organization: Univ Netw Serv, Univ of Minn
Lines: 33


Written by: Lauren Nelson
What: Prime factorizer
When: 10 May 1990

PRIME	Stack Input:	real number
	Stack Output:	list containing the input's prime factors

Checksum: #47966d
Size: 192
------------------------------------------------------------
%%HP: T(3)A(D)F(.);
\<< { } SWAP
  WHILE DUP 2 MOD 0
==
  REPEAT 2 / SWAP 2
+ SWAP
  END DUP \v/ 1 1 ROT
  START 2 +
    WHILE DUP2 MOD
0 ==
    REPEAT DUP 4
ROLL SWAP + ROT ROT
DUP ROT SWAP / SWAP
    END 2
  STEP ROT ROT DUP
1
  IF ==
  THEN DROP SWAP
DROP
  ELSE + SWAP DROP
  END
\>>


