up previous next
FactorINT --
find prime factors of an integer
|
FactorINT(N: INT): RECORD
FactorINT_TrialDiv(N: INT, MaxPrime: INT): RECORD
FactorINT_PollardRho(N: INT, Niters: INT): RECORD |
These functions find the (small) prime factors of an integer.
FactorINT
tries to find all factors (usually prime); it may take a very long time!
FactorINT_TrialDiv does trial division by all primes up to
MaxPrime;
be wary of giving large values for
MaxPrime.
FactorINT_PollardRho performs
Niters of the Pollard-Rho algorithm;
if no factor was found, the result is an empty factorization. The factor
found may not be prime! Be wary of specifying large values for
Niters.
From version 5.0.4, to comply with the naming conventions, the fields are
called
factors and
multiplicities instead of
Factors
and
Exponents.
/**/ FactorINT_TrialDiv(100,3);
record[factors := [2], multiplicities := [2], RemainingFactor := 25]
/**/ FactorINT(123456789);
record[factors := [3, 3607, 3803], multiplicities := [2, 1, 1], RemainingFactor := 1]
|