Hi all,
I have moved the ifactor package from contrib into src. So factor now
uses ifactor package to factor integers and the primality testing is
now probabilistic.
This changes the behaviour of factor (for integer), primep and
intfaclim. Also there are two new functions ifactors and power_mod.
Here is the updated documentation (I'm not including the documentation
for factor - I only added a comment about factoring integers)
-- Option variable: intfaclim
Default value: true
If `true', maxima will give up factorization of integers if no
factor is found after trial divisions and Pollard's rho method and
factorization will not be complete.
When `intfaclim' is `false' (this is the case when the user calls
`factor' explicitly), complete factorization will be attempted.
`intfaclim' is set to `false' when factors are computed in
`divisors', `divsum' and `totient'.
Internal calls to `factor' respect the user-specified value of
`intfaclim'. Setting `intfaclim' to `false' may reduce the time
spent factoring large integers.
-- Function: primep (<n>)
Primality test. If `primep (n)' returns `false', <n> is a
composite number and if it returns `true', <n> is a prime number
with very high probability.
For <n> less than 34155071728321 a deterministic version of
Miller-Rabin's test is used. If `primep (n)' returns `true', then
<n> is a prime number.
For <n> bigger than 34155071728321 `primep' uses
`primep_number_of_tests' Miller-Rabin's pseudo-primality tests and
one Lucas pseudo-primality test. The probability that <n> will
pass one Miller-Rabin test is less than 1/4. Using the default
value 25 for `primep_number_of_tests', the probability of <n>
beeing composite is much smaller that 10^-15.
-- Function: ifactors (<n>)
For a positive integer <n> returns the factorization of <n>. If
`n=p1^e1..pk^nk' is the decomposition of <n> into prime factors,
ifactors returns `[[p1, e1], ... , [pk, ek]]'.
Factorization methods used are trial divisions by primes up to
9973, Pollard's rho method and elliptic curve method.
(%i1) ifactors(51575319651600);
(%o1) [[2, 4], [3, 2], [5, 2], [1583, 1], [9050207, 1]]
(%i2) apply("*", map(lambda([u], u[1]^u[2]), %));
(%o2) 51575319651600
-- Function: power_mod (<a>, <n>, <m>)
Computes `a^n mod m' where <a> is an integer and <n> and <m> are
positive integers.
(%i1) power_mod(3, 15, 5);
(%o1) 2
(%i2) ratsimp(3^15), modulus=5;
(%o2) 2
Please report any problems (and correct my English in the documentation;).
Andrej