HaskellForMaths-0.4.4: Combinatorics, group theory, commutative algebra, non-commutative algebra

Safe HaskellSafe-Infered

Math.NumberTheory.Factor

Description

A module for finding prime factors.

Synopsis

Documentation

pfactors :: Integer -> [Integer]Source

List the prime factors of n (with multiplicity). The algorithm uses trial division to find small factors, followed if necessary by the elliptic curve method to find larger factors. The running time increases with the size of the second largest prime factor of n. It can find 10-digit prime factors in seconds, but can struggle with 20-digit prime factors.