Number and Factorization Tools

Explore various utilities for working with numbers, including factorization and prime number analysis.

See my blog post Factoring Integers After The Dark Ages for a discussion of the number theory behind how these factoring tools work.

How SymPy's `factorint` Works

The factorization tool on this site uses SymPy's powerful `factorint` function. SymPy is a Python library for symbolic mathematics, and `factorint` is designed to find the prime factors of an integer. It employs a combination of sophisticated algorithms, including trial division for small factors, Pollard's rho algorithm, and the Pollard's p-1 algorithm for larger factors, among others. For very large numbers, it can even use more advanced methods like the Quadratic Sieve if necessary.

To prevent excessively long computations for extremely large numbers, the site implements a timeout mechanism. If factorization exceeds a predefined time limit (currently 5 seconds), the process is halted, and a timeout message is displayed. For smaller numbers (less than 10^9), the function is called directly without the timeout overhead to ensure quick results.

Start factoring numbers by visiting the Factorization Tool.

How YAFU (Yet Another Factoring Utility) Works

For more demanding factorization tasks, the Factor Ex tool uses YAFU, a highly optimized command-line utility for the automated factoring of integers. YAFU is known for its speed and its ability to intelligently switch between a wide range of powerful algorithms, including the Elliptic Curve Method (ECM), the Self-Initializing Quadratic Sieve (SIQS), and even the General Number Field Sieve (GNFS) for truly massive numbers.

Unlike the standard factorization tool, YAFU allows for a customizable timeout (up to 60 seconds), making it more suitable for exploring larger or more "difficult" integers. It provides a detailed log of its factorization process, allowing you to see exactly which methods were employed to find each prime factor.