nzmath . factor

methods

The module provides factoring methods.

It uses methods of find module to find a factor and classes of util module to track the factorization process.

Functions

factor(n [, method, **options])

Factor the given integer n.

By default, use several methods internally.
Optional argument 'method' can be:

(In fact, its initial letter suffice to specify.)

ecm(n [,**options])

Factor the given integer n by elliptic curve method.
(see ecm of ecm module.)

mpqs(n [, **options])

Factor the given integer n by multi-polynomial quadratic sieve method.
(see mpqsfind of mpqs module.)

pmom(n [, **options])

Factor the given integer n by Pollard's p-1 method. The method may fail unless n has an appropriate factor for the method.
(see pmom of find module.)

rhomethod(n [, **options])

Factor the given integer n by rho method. But the method is a probabilistic method, possibly fails in factorizations.
(see rhomethod of find module.)

trialDivision(n [, **options])

Factor the given integer n by trial division.

options for the trial sequence can be either:

  1. 'start' and 'stop' as range parameters.
  2. 'iterator' as an iterator of primes.
  3. 'eratosthenes' as an upper bound to make prime sequence by sieve.

If none of the options above are given, prime factor is searched from 2 to the square root of the given integer.
(see trialDivision of find module.)


Last-modified: 2007-03-24 (إع) 10:08:32