Integer factorization seeks the prime factorization of a positive integer . For , this means identifying its prime factors and their multiplicities; one has the empty prime factorization. Finding one proper divisor is useful progress, but need not finish the job: factor and further until all factors are prime numbers.
For example, is a semiprime, whereas has three prime factors. Primality testing asks whether a proposed integer is prime; it need not return a factor when the answer is no. Trial division is a direct factoring method: try division by small prime numbers until a divisor is found. More elaborate methods obtain a proper divisor through a greatest common divisor of with a specially constructed integer.
The beautiful trick in congruence of squares is that two integers with equal squares modulo can reveal different factors through their sum and difference. In the worked example, gives and . Computing those greatest common divisors uses the Euclidean algorithm; it does not require trying every potential factor. A factor base supplies a systematic way to construct useful equal-square relations. [ref].
This connection is useful in cryptography because recovering the factors of an RSA cryptosystem modulus defeats the factoring assumption behind its construction. That application concerns large, carefully chosen inputs; the small examples here explain the arithmetic mechanism and are not benchmarks or estimates of present cryptographic security.
The elliptic-curve factorization method searches for a nontrivial divisor of a composite integer by doing elliptic curve arithmetic modulo . Hendrik W. Lenstra's method replaces the multiplicative group in Pollard's p-1 algorithm with a group whose order varies as the curve varies. For an unknown prime divisor , a curve for which the order of the chosen point has only small prime factors can make a suitably chosen multiple of that point vanish modulo without vanishing modulo every prime divisor of .[ref]
In affine-coordinate arithmetic, trying to invert a denominator modulo can fail. Computing the greatest common divisor then yields a factor if . A full gcd of is inconclusive; another curve or point may be needed. Implementations can accumulate this information with projective coordinates rather than attempting an inversion at every step.
For a small worked example, take , the curve , and . Its discriminant is coprime to . The usual addition formulas give and modulo . Adding these to form calls for inversion of . Since , the failed division exposes a prime divisor. This elementary example illustrates the mechanism; the method's practical advantage is its dependence on the size of the factor sought, rather than only on the size of .
For an integer to be factored, John Pollard's method chooses an integer coprime to and an exponent divisible by many small prime powers. Compute by modular exponentiation and the Euclidean algorithm. If , it is a proper divisor. If a prime divisor of has , Fermat's little theorem ensures ; success requires some other prime divisor not to divide . Common choices are and . The method exploits a smooth , rather than a small divisor itself.
A general-purpose classical integer factorization algorithm combining polynomial relations, arithmetic in number fields and sparse linear algebra to construct congruent squares modulo the input. Its familiar general-input complexity estimate is heuristic and subexponential in the input's value, roughly for input bits. This is not polynomial in the bit length. Special input structure, small factors and preprocessing can make other algorithms preferable.
An ordered factorization of a positive integer is an ordered list of factors greater than one whose product is . For example, , , and are the three ordered factorizations of . Taking successive partial products gives a bijection with strictly increasing divisor chains from to .
An integer factorization algorithm that iterates a simple map such as and searches for a nontrivial greatest common divisor of and the difference of two iterates. A collision modulo an unknown prime factor can reveal that factor before a collision modulo . A cycle detection schedule such as Floyd's cycle-finding algorithm limits the number of stored iterates. Unsuccessful choices of seed or map can be retried.
The Brent variant of Pollard rho finds factors of a composite integer by iterating a map such as . A collision modulo an unknown prime factor can be detected through . Brent's variant organizes comparisons in blocks whose lengths double, reducing the work of cycle detection compared with comparing two iterates at every step.[ref]
It can also batch differences: compute their product modulo and take one greatest common divisor per block. If that gcd is , retry the saved differences individually to recover a proper factor, or restart with a different orbit. The commonly used square-root-of-factor runtime estimate is heuristic and depends on treating the orbit modulo that factor like a random map.
A factor base is a finite set of small prime numbers over which selected auxiliary integers are completely factored. Some methods also record a sign coordinate for , which is not a prime number. A positive integer supported entirely on the chosen factor base gives an exponent vector; reducing that vector modulo two records which prime exponents are odd integers. The product is a square of a number precisely when every prime exponent is an even integer.
For the original toy , use factor base and the two relations
The residues have exponent vectors and in the order . Adding the two vectors modulo two gives , so multiplying the residues gives . Consequently
and and . Neither individual residue was a square; combining the relations made all exponents even.
Figure 1.
A factor base turns two smooth relations into a congruence of squares through exponent parity
. The original example uses the ordered factor base . The rows and add to zero modulo two, giving residue product . The product of the original inputs is ; greatest common divisor calculations then extract seven and eleven. Details.
In a larger collection, choose relations with positive residues . If a nonempty selection has an even sum in every exponent coordinate, set
Then . Finding such a selection is a linear dependence problem over the finite field : the indicator vector of the chosen relations belongs to the kernel of a linear map given by the parity matrix. This is why a problem about prime factors recruits linear algebra. The final congruence of squares may still be trivial, so another selection can be needed. [ref].
There is a tradeoff: a small factor base gives a smaller parity matrix, but fewer auxiliary integers factor completely over it. A larger factor base accepts more relations but makes the linear algebra larger. Negative auxiliary values need an additional sign coordinate, and a selected product needs even sign parity as well as even prime exponents. Pomerance's account explains this balance and the historical development of combining smooth relations; the toy example omits algorithm-specific sieving and running-time claims. [ref].
Relative to an ordered factor base , a positive integer has exponent vector . Multiplication of such integers adds their exponent vectors. Reducing every coordinate modulo two gives the parity vector used to find congruences of squares. The ordering and any sign coordinate must be used consistently across all rows.
For positive integers and a prime , their prime-exponent difference is , where is the exponent in prime factorization. This is the exponent of in the positive rational number , and it may be negative.
For and , the differences are at and at , giving . The quotient is an integer exactly when every difference is nonnegative. It is a rational th power exactly when every difference is divisible by , making exponent differences useful for perfect-power and divisibility tests.
The odd part of a positive integer is the unique odd positive integer obtained by repeatedly dividing by two. The process terminates because the positive integers decrease. If with odd, then would make even and would make even; hence and . Two positive integers have the same odd part exactly when their ratio is an integral power of two. The odd positive integers therefore give representatives for the resulting equivalence classes.
A congruence of squares says that two integers have the same square modulo a positive integer . Factoring their difference of squares gives
A useful integer factorization results when or is a proper divisor of . Divisibility of a product does not generally force divisibility of either factor by all of : different prime factors of can divide different parts of that product.
For , . Therefore
Thus . The prime seven divides the difference, while eleven divides the sum. These computations already give a complete prime factorization because seven and eleven are prime numbers.
The Chinese remainder theorem explains the hidden sign choices. The four congruence classes solving have representatives . Modulo seven each is or ; modulo eleven each is or . Two independent sign choices produce four roots. The inputs thirteen and twenty agree modulo seven and disagree by sign modulo eleven, allowing their sum and difference to separate the two prime factors.
Figure 1. . Each cell gives the unique residue modulo with its indicated residues modulo seven and eleven. Relative to input thirteen, input twenty agrees modulo seven and has the opposite sign modulo eleven. The resulting greatest common divisors are seven and eleven. Diagonal all-same or all-opposite choices give only the trivial factors one and . Details.
For distinct odd prime numbers , and , a solution with and modulo yields both proper factors by the two greatest common divisors. For a general composite integer, a proper divisor need not itself be prime; further factoring can remain. If or in the coprime case, the two calculations return and one instead. A factor base helps generate relations, but does not ensure every resulting relation is useful.
For historical context, Pomerance describes Kraitchik's 1920s enhancement of the difference-of-squares approach associated with Fermat: seek a difference that is a multiple of , rather than exactly . His account also notes antecedents in Gauss and Seelhoff, so this is not an attribution of the whole idea to a single inventor. [ref].
For an odd integer , a nontrivial square root of unity modulo is a residue with and . Then both and are proper divisors. For , works: , , and .
A congruence of squares with converts to this form by , using a modular multiplicative inverse. In the example, , so . It yields and . Nontriviality requires mixed sign choices across prime factors, which an odd prime number modulus cannot provide.

Ancestors (4)

  1. Number theory
  2. Area of mathematics
  3. Mathematics
  4. Home

Synonyms (1)

Discussion (0) New discussion

There are no discussions about this article yet.

Articles by others on the same topic (2)

Integer factorization is the process of decomposing an integer into a product of smaller integers, specifically into prime numbers. For example, the integer 28 can be factored into prime numbers as \(2^2 \times 7\), where 2 and 7 are prime numbers. The goal of factorization is to find these prime factors. The significance of integer factorization lies in its applications, particularly in number theory and cryptography.
Integer factorization by Ciro Santilli 40 Updated 2025-10-14
Complexity: NP-intermediate as of 2020:
The basis of RSA: RSA. But not proved NP-complete, which leads to: