Hubbry Logo
Dixon's factorization methodDixon's factorization methodMain
Open search
Dixon's factorization method
Community hub
Dixon's factorization method
logo
7 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
Dixon's factorization method
Dixon's factorization method
from Wikipedia

In number theory, Dixon's factorization method (also Dixon's random squares method[1] or Dixon's algorithm) is a general-purpose integer factorization algorithm; it is the prototypical factor base method. Unlike for other factor base methods, its run-time bound comes with a rigorous proof that does not rely on conjectures about the smoothness properties of the values taken by a polynomial.

The algorithm was designed by John D. Dixon, a mathematician at Carleton University, and was published in 1981.[2]

Basic idea

[edit]

Dixon's method is based on finding a congruence of squares modulo the integer N which is intended to factor. Fermat's factorization method finds such a congruence by selecting random or pseudo-random x values and hoping that the integer x2 mod N is a perfect square (in the integers):

For example, if N = 84923, (by starting at 292, the first number greater than N and counting up) the 5052 mod 84923 is 256, the square of 16. So (505 − 16)(505 + 16) = 0 mod 84923. Computing the greatest common divisor of 505 − 16 and N using Euclid's algorithm gives 163, which is a factor of N.

In practice, selecting random x values will take an impractically long time to find a congruence of squares, since there are only N squares less than N.

Dixon's method replaces the condition "is the square of an integer" with the much weaker one "has only small prime factors"; for example, there are 292 squares smaller than 84923; 662 numbers smaller than 84923 whose prime factors are only 2,3,5 or 7; and 4767 whose prime factors are all less than 30. (Such numbers are called B-smooth with respect to some bound B.)

If there are many numbers whose squares can be factorized as for a fixed set of small primes, linear algebra modulo 2 on the matrix will give a subset of the whose squares combine to a product of small primes to an even power — that is, a subset of the whose squares multiply to the square of a (hopefully different) number mod N.

Method

[edit]

Suppose the composite number N is being factored. Bound B is chosen, and the factor base is identified (which is called P), the set of all primes less than or equal to B. Next, positive integers z are sought such that z2 mod N is B-smooth. Therefore we can write, for suitable exponents ai,

When enough of these relations have been generated (it is generally sufficient that the number of relations be a few more than the size of P), the methods of linear algebra, such as Gaussian elimination, can be used to multiply together these various relations in such a way that the exponents of the primes on the right-hand side are all even:

This yields a congruence of squares of the form a2b2 (mod N), which can be turned into a factorization of N, N = gcd(a + b, N) × (N/gcd(a + b, N)). This factorization might turn out to be trivial (i.e. N = N × 1), which can only happen if a ≡ ±b (mod N), in which case another try must be made with a different combination of relations; but if a nontrivial pair of factors of N is reached, the algorithm terminates.

Pseudocode

[edit]

This section is taken directly from Dixon (1981).

Dixon's algorithm

Initialization. Let L be a list of integers in the range [1, n], and let P = {p1, ..., ph} be the list of the h primes ≤ v. Let B and Z be initially empty lists (Z will be indexed by B).

Step 1. If L is empty, exit (algorithm unsuccessful). Otherwise, take the first term z from L, remove it from L, and proceed to Step 2.

Step 2. Compute w as the least positive remainder of z2 mod n. Factor w as:

where w has no factor in P. If w = 1, proceed to Step 3; otherwise, return to Step 1.

Step 3. Let a ← (a1, ..., ah). Add a to B and z to Z. If B has at most h elements, return to Step 1; otherwise, proceed to Step 4.

Step 4. Find the first vector c in B that is linearly dependent (mod 2) on earlier vectors in B. Remove c from B and from Z. Compute coefficients such that:

Define:

Proceed to Step 5.

Step 5. Compute:

so that:

If or , return to Step 1. Otherwise, return:

which provides a nontrivial factor of n, and terminate successfully.

Step-by-step example : factorizing (n = 84923) using Dixon's algorithm

[edit]

This example is lifted directly from the LeetArxiv substack.[3] Credit is given to the original author.

  • Initialization:
    • Define a list of numbers L, ranging from 1 to 84923:
  • Define a value v, which is the smoothness factor:
  • Define a list P containing all the prime numbers less than or equal to v:
  • Define B and Z, two empty lists. B is a list of powers, while Z is a list of accepted integers:
  • Step 1: Iterating values
    • Write a for loop that indexes the list . Each element in is indexed as . The for loop exits at the end of the list.
int n = 84923;
for (int i = 1; i <= n; i++)
{
    int z = i;
}
  • Step 2: Computing and v-smooth Prime Factorization
    • To proceed, compute for each z, then express the result as a prime factorization.
This step continues for all values of z in the range.
  • Step 3: If is 7-smooth, then append its powers to list and append to list .
  • Step 4: This step is split into two parts.
Part 1: Find modulo 2.
Part 2: Check if any row combinations of sum to even numbers
For example, summing Row and Row gives us a vector of even numbers.
and
then
.


  • Step 5 : This step is split into four parts.
    • Part 1. (Finding x): Multiply the corresponding values for the rows found in Step 4. Then find the square root. This gives us .
      • For Row 2, we had .
      • For Row 3, we had .
      • Thus, we find  :
  • Part 2. (Finding y): Multiply the corresponding smooth factorizations for the rows found in Step 4. Then find the square root. This gives us .
  • Part 3. (Find x + y and x - y) where x = 20712 and y = 16800.
  • Part 4. Compute GCD(x+y, n) and GCD(x-y, n), where n = 84923, x+y = 292281 and x-y = 258681

Quick check shows .

Optimizations

[edit]

The quadratic sieve is an optimization of Dixon's method. It selects values of x close to the square root of N such that x2 modulo N is small, thereby largely increasing the chance of obtaining a smooth number.

Other ways to optimize Dixon's method include using a better algorithm to solve the matrix equation, taking advantage of the sparsity of the matrix: a number z cannot have more than factors, so each row of the matrix is almost all zeros. In practice, the block Lanczos algorithm is often used. Also, the size of the factor base must be chosen carefully: if it is too small, it will be difficult to find numbers that factorize completely over it, and if it is too large, more relations will have to be collected.

A more sophisticated analysis, using the approximation that a number has all its prime factors less than with probability about (an approximation to the Dickman–de Bruijn function), indicates that choosing too small a factor base is much worse than too large, and that the ideal factor base size is some power of .

The optimal complexity of Dixon's method is

in big-O notation, or

in L-notation.

References

[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
Dixon's factorization method is a probabilistic for , introduced by mathematician John D. Dixon in , that efficiently finds non-trivial factors of a large composite nn by searching for quadratic residues modulo nn whose prime factors lie within a carefully chosen small set of primes, known as the factor base, and then applying linear algebra over the F2\mathbb{F}_2 to derive a congruence of squares that yields a factor via the operation. The method operates in two primary phases: first, it generates a sufficient number of pairs (zi,wi)(z_i, w_i) where zi2wi(modn)z_i^2 \equiv w_i \pmod{n} and wiw_i factors completely into primes from the factor base PP, producing exponent vectors for each wiw_i; second, it identifies a linear dependence among these vectors modulo 2, allowing the construction of integers xx and yy such that x2y2(modn)x^2 \equiv y^2 \pmod{n} with x≢±y(modn)x \not\equiv \pm y \pmod{n}, after which gcd(n,xy)\gcd(n, x - y) or gcd(n,x+y)\gcd(n, x + y) provides a proper factor of nn with probability at least 1/2. Dixon's algorithm selects the factor base PP as the set of small primes up to approximately exp((2lnnlnlnn)1/2)\exp\left( (2 \ln n \ln \ln n)^{1/2} \right), balancing the trade-off between the smoothness probability of the residues and the computational cost of Gaussian elimination on the resulting matrix, which has dimensions roughly equal to the size of PP. The expected running time is O(exp(c(2lnnlnlnn)1/2))O\left(\exp\left(c (2 \ln n \ln \ln n)^{1/2}\right)\right) arithmetic operations for some constant c>0c > 0, making it asymptotically superior to earlier deterministic methods that required at least O(n1/5)O(n^{1/5}) time, though in practice, it has been superseded by more efficient variants like the quadratic sieve due to optimizations in smooth number generation. Notable for its theoretical breakthrough in subexponential , the method is particularly suited to parallel implementation, as the search for smooth residues can be distributed across multiple processors, and it laid foundational groundwork for subsequent advances in cryptographic by demonstrating that factoring could be performed in subexponential time relative to the size of nn.

Introduction

Overview

Dixon's factorization method is a probabilistic for , designed to find non-trivial factors of a composite n>1n > 1 by identifying relations among smooth numbers modulo nn. Developed by John D. Dixon in 1981, it represents a foundational factor base approach that operates in subexponential time, making it suitable for factoring large semiprimes without relying on special form assumptions about nn. The core principle relies on selecting random integers kk and computing k2modnk^2 \mod n, then factoring these residues completely over a carefully chosen factor base of small primes to obtain exponent vectors. Dependencies among these vectors are solved via linear algebra over the field GF(2), yielding a that produces a perfect square congruent to another square modulo nn, from which factors are derived using the . This process exploits the higher density of smooth values in the residues compared to random integers, enabling efficient relation collection. In the , the method provided an efficient bridge between trial division and advanced sieving techniques like the , feasible for relatively small composites up to around 20-30 digits on contemporary hardware, though its theoretical complexity O(exp(c(lnnlnlnn)1/2))O(\exp(c (\ln n \ln \ln n)^{1/2})) for some constant cc highlighted its asymptotic advantages. The primary output is a pair of non-trivial factors pp and qq such that n=pqn = p \cdot q, assuming nn is , with a high probability of success upon finding a suitable square congruence.

Historical development

Dixon's factorization method was invented by mathematician John D. Dixon at Carleton University and first published in 1981 in the paper "Asymptotically fast factorization of integers," appearing in Mathematics of Computation. The method emerged in the context of advancing integer factorization techniques amid the rise of public-key cryptography, particularly following the introduction of the RSA cryptosystem in 1978. It addressed limitations in prior approaches, such as the continued fraction factorization algorithm developed by Morrison and Brillhart in 1975, by providing the first probabilistic factoring algorithm with a rigorously proven subexponential expected running time of Ln[32]L_n[3\sqrt{2}]
Add your contribution
Related Hubs
User Avatar
No comments yet.