commands → primefactors

primefactors(A)

The primefactors command returns a vector of prime factors of A, where A is an integer.

Examples

primefactors(12);
	[2,2,3]

Algorithm

The algorithm uses trial division, Pollard rho, and the Lenstra elliptic curve method.

References

Link to Handbook of Applied Cryptography
Cohen, Henri. A Course in Computational Algebraic Number Theory. Springer, 1993.
Koblitz, Neal. A Course in Number Theory and Cryptography. Springer, 1998.