Integer factorization asks for the prime decomposition of a positive integer. Given
The Factorization Problem
Integer factorization asks for the prime decomposition of a positive integer. Given
we seek primes
and positive exponents
such that
The fundamental theorem of arithmetic guarantees that this decomposition exists and is unique up to the order of the factors.
Computationally, however, finding the factors may be difficult. This distinction between existence and efficient discovery is one of the central themes of computational number theory.
Trial Division
The simplest factorization method is trial division. One tests whether is divisible by
up to
If a divisor is found, the integer splits. If no divisor is found, then is prime.
Trial division is useful for removing small factors, but it is ineffective for large integers. If has hundreds or thousands of bits, checking all possible divisors is infeasible.
In practice, trial division is usually used only as a preprocessing step.
Fermat Factorization
Fermat factorization is based on writing an odd integer as a difference of squares:
If has two factors close to each other, then such a representation may be found quickly.
For example, one searches for an integer near such that
is a square.
This method is efficient when the factors of are close together, but poor when they are far apart.
Pollard’s Rho Method
Pollard’s rho method is a probabilistic algorithm designed to find nontrivial factors.
The method constructs a pseudorandom sequence modulo , such as
If is an unknown prime factor of , the sequence modulo eventually cycles. A collision modulo may reveal itself through
If this greatest common divisor is neither nor , it is a nontrivial factor.
Pollard’s rho is especially effective for finding relatively small prime factors of large integers.
Pollard’s Method
Pollard’s method exploits smoothness.
Suppose , and suppose
factors completely into small primes. Then one can often find by computing
where is divisible by many small prime powers.
The method works because Fermat’s theorem gives
If , then
Thus divides , and a greatest common divisor may expose it.
This method is powerful when a prime factor has smooth , but unreliable otherwise.
Smooth Numbers
A positive integer is called -smooth if all of its prime factors are at most .
Smooth numbers play a major role in modern factorization.
Many algorithms try to construct congruences involving smooth numbers, because smooth integers can be factored easily over a fixed factor base.
The probability that a random integer near is -smooth governs the efficiency of several major factorization methods.
Congruence of Squares
Many factorization algorithms are based on the following idea.
If one can find integers and such that
but
then
Therefore
may produce a nontrivial factor.
This is the central mechanism behind the quadratic sieve and the number field sieve.
Dixon’s Method
Dixon’s method searches for random integers such that
is smooth over a chosen factor base.
After collecting enough smooth relations, linear algebra over
finds a subset whose product is a square.
This yields a congruence of squares modulo .
Dixon’s method is conceptually important because it shows how smoothness and linear algebra combine to produce factors.
Quadratic Sieve
The quadratic sieve improves Dixon’s method by selecting values near .
One considers
If is smooth, then
By collecting many smooth values of , one obtains enough relations to build a congruence of squares.
The quadratic sieve was historically the fastest general-purpose factorization algorithm for large integers before the number field sieve became dominant.
It remains effective for integers of moderate size.
Number Field Sieve
The number field sieve is the fastest known classical general-purpose algorithm for factoring large integers.
Its central idea is to construct smooth relations simultaneously in two rings:
- the ordinary integer ring,
- a suitable algebraic number field.
These relations are combined through large sparse linear algebra to produce a congruence of squares modulo .
The number field sieve has subexponential complexity and is the method used for the largest publicly known factorizations of RSA-type integers.
Its complexity is often written informally as
where
This notation measures subexponential running time between polynomial and exponential growth.
Elliptic Curve Method
The elliptic curve method, usually called ECM, is especially effective for finding medium-sized prime factors.
It generalizes Pollard’s method by replacing the multiplicative group modulo with the group of points on a random elliptic curve over .
The group order varies with the curve. By trying many curves, one increases the chance that the group order is smooth.
ECM is highly effective in practice for discovering factors that are not too large, even when the full integer is enormous.
Special-Purpose Algorithms
Some integers have special forms that allow faster factorization.
Examples include:
and numbers arising from algebraic sequences.
Special structure may reveal algebraic factors before general-purpose methods are needed.
For instance,
Recognizing such identities can dramatically simplify a factorization problem.
Factorization and Cryptography
The security of RSA depends on the presumed difficulty of factoring large semiprimes
where and are large secret primes.
If an attacker can factor , then the private key can be recovered.
This makes integer factorization one of the most important computational problems in applied number theory.
The practical difficulty of factoring large RSA moduli rests on the absence of known efficient classical algorithms for general factorization.
Quantum Factorization
Quantum computation changes the landscape.
Shor’s algorithm factors integers in polynomial time on a sufficiently large fault-tolerant quantum computer.
This does not currently make RSA instantly obsolete in all deployed settings, because building such quantum machines at cryptographic scale remains a major engineering challenge. But theoretically, it shows that factorization is easy in the quantum model.
This is one reason post-quantum cryptography studies systems based on problems other than integer factorization and discrete logarithms.
Factoring Versus Primality Testing
It is important to distinguish factorization from primality testing.
Primality testing asks whether is prime.
Factorization asks for the complete prime decomposition of .
The first problem is known to be solvable in deterministic polynomial time. The second has no known polynomial-time classical algorithm.
Thus an integer can be easy to recognize as composite while still being hard to factor.
Practical Factorization Strategy
A practical factorization system usually combines several methods:
- trial division to remove small factors,
- Pollard rho for small to medium factors,
- ECM for medium factors,
- quadratic sieve for moderate composite numbers,
- number field sieve for large difficult composites.
The best method depends on the size of , the size of its unknown factors, and any special algebraic structure.
Conceptual Importance
Integer factorization lies at the intersection of elementary arithmetic and deep computation.
The problem begins with the fundamental theorem of arithmetic, but its efficient solution involves:
- modular arithmetic,
- smooth numbers,
- elliptic curves,
- algebraic number fields,
- sparse linear algebra,
- analytic estimates,
- computational complexity.
Factorization illustrates a recurring pattern in modern number theory: simple questions about integers can require powerful structures from many areas of mathematics.