(Comp.sources.hp48) Item: 104 by kalb@informatik.uni-erlangen.de Author: [Klaus Kalb] Subj: fctr - Factoring v1.2 Date: Mon May 04 1992 FCTR is a library for the pocket calculator HP48SX to recognize prime numbers and factor integers into primes. All commands supplied by FCTR are also contained in the library NTL2. This library is meant for persons who want the Factor program but don't have enough room to keep NTL2. [Like me! -jkh-] It is provided as is, without any warranty or assertion of fitness for any purpose. Note that this library makes use of undocumented and unsupported features of the HP48. This might cause data loss or even hardware damage. Use it at your own risk. This software may be distributed freely for noncommercial purposes, as long as this file and the documentation file is distributed with it. You may not make any changes to the software or to the documentation, put it into ROM, publish it in journals or sell it without written permission of the author. Parts of the code in this library were developed by Jurjen N. E. Bos and are included with his kind permission. Thus this library contains a slightly improved version of his `Ultimate Factoring Program'. 15/4/92, -KK Klaus Kalb Huettendorfer Weg 14 W-8510 Fuerth 17 Federal Republic of Germany email: kskalb@informatik.uni-erlangen.de This is the complete documentation of the library FCTR version 1.2. The ID of this library is 1671 and the title reads `FCTR 1.2 Factoring` The command `AboutFCTR` should display the following screen: FCTR 1.2 Factoring created 04/15/92 00:38 (C) 1992 by Klaus Kalb Credits to Jurjen Bos and return the version identification string "1.2" to level 1. ---------- THE LIBRARY COMMANDS ---------- Prm? Tests wether its argument is a prime number Returns 1 if it's a prime, else 0 If the number to test is greater then 25*10^9, the test may take up to several minutes. Negative primes are recognized correctly mode maps: #m -> 0/1 m -> 0/1 NPrm Finds the smallest prime greater then the absolute value of the argument mode maps: #x -> #p x -> p PPrm Finds the greatest prime less then the absolute value of the argument mode maps: #x -> #p x -> p Factor Factors its argument into primes The output will be a list containing all prime divisors (repeated according to their multiplicity) in ascending order. The entries in the list will have the same type as the argument. The number to be factored must be positive. mode maps: #x -> { #p_1 #p_2 ... } x -> { p_1 p_2 ... }