ArticleslgStudy

mathematics

Dixon's factorization method

Dixon's factorization method is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Dixon's factorization method rather than just read about it. In short: In number theory, Dixon's factorization method (also Dixon's random squares method 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.

Key takeaways

  • Dixon's factorization method belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Dixon's factorization method to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Dixon's factorization method from memory before moving on to harder problems.

Reference excerpt

In number theory, Dixon's factorization method (also Dixon's random squares method 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.

Basic idea Dixon's method is based on finding a congruence of squares modulo the integer N which is intended to factor. We explain the basic idea here by first describing Fermat's factorization method, then how Dixon's method proceeds differently. 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 nontrivial perfect square (in the integers):

x2≡y2(mod N),x≢±y(mod N). 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 a nontrivial perfect square" 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 7-smooth and 30-smooth, respectively, since they are B-smooth with respect to some bound B.) Once enough of these B-smooth values are found, linear algebra can be used to search for nontrivial perfect squares for Fermat's factorization method. If there are many numbers a1…an whose squares can be factorized as ai2modN=∏j=1mbjeij for a fixed set b1…bm of small primes, linear algebra modulo 2 on the matrix eij will give a subset of the ai whose squares combine to a product of small primes to an even power — that is, a subset of the ai whose squares multiply to the square of a (hopefully different) number mod N.

Method 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,

z2 mod N=∏pi∈Ppiai 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:

z12z22⋯zk2≡∏pi∈Ppiai,1+ai,2+⋯+ai,k (modN)(where ai,1+ai,2+⋯+ai,k≡0(mod2)) This yields a congruence of squares of the form a2 ≡ b2 (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 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: w=w′∏ipiai 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 zc from Z. Compute coefficients fb such that: 𝐜≡∑b∈Bfb𝐛(mod2) Define: 𝐝=(d1,…,dn)←12(𝐜+∑fb𝐛) Proceed to Step 5. Step 5. Compute: x←zc∏bzbfb,y←∏ipidi so that: x2≡∏ipi2di=y2modn. If x≡y or x≡−y(modn), return to Step 1. Otherwise, return: gcd⁡(n,x+y) which provides a nontrivial factor of n, and terminate successfully.

Step-by-step example In this example, we factorize (n = 84923) using Dixon's algorithm. This example is lightly adapted from the LeetArxiv substack. Credit is given to the original author.

Initialization: Define a list of numbers L, ranging from 1 to 84923: L={1,…,84923} Define a value v, which is the smoothness factor: v=7 Define a list P containing all the prime numbers less than or equal to v: P=2,3,5,7 Define B and Z, two empty lists. B is a list of powers, while Z is a list of accepted integers: B=[] Z=[] Step 1: Iterating z values Start a for loop that indexes the list L. The current element in L is labeled as z. The for loop exits at the end of the list, or when Step 5 breaks the loop.

Step 2: Computing z2modn and v-smooth Prime Factorization To proceed, compute z2mod84923 for each z, then express the result as a prime factorization. 12mod84923≡1mod84923=20⋅30⋅50⋅70mod84923 ⋮ 5132mod84923=8400mod84923=24⋅31⋅52⋅71mod84923 ⋮ 5372mod84923=33600mod84923=26⋅31⋅52⋅71mod84923 5382mod84923=34675mod84923=52⋅191⋅731mod84923 This step continues for all values of z in the range. Step 3: Appending v-smooth results If z2mod84923 is 7-smooth, then append its powers to list B and append z to list Z. If B has at most h=4 elements, return to Step 1. Otherwise, proceed to Step 4. For example, after 537 iterations, we have: Z={1,…,513,537} B={[0,0,0,0],…,[4,1,2,1],[6,1,2,1]} and we proceed on to Step 4 since we would have more than h=4 vectors in B. Step 4: This step is split into two parts. Part 1: Finding B modulo 2 B=(000041216121)mod2≡B=(000001010101) Part 2: Finding a row combination of B that sums to even numbers For example, summing Row 2 and Row 3 gives us a vector of even numbers. R2={0,1,0,1} and R3={0,1,0,1} then R2+R3={0,1,0,1}+{0,1,0,1} R2+R3={0,2,0,2}.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Dixon's factorization method

Start with the simplest possible case. Write down what Dixon's factorization method claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Dixon's factorization method before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Dixon's factorization method ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Dixon's factorization method

In research
Dixon's factorization method appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Dixon's factorization method in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Dixon's factorization method is common in secondary-school and first-year university syllabi. It links to neighbouring topics Integer factorization algorithms, Squares in number theory, so understanding it makes those chapters shorter.
In everyday life
Look for Dixon's factorization method outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Dixon's factorization method” →

How to study Dixon's factorization method in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Dixon's factorization method means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Dixon's factorization method out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Dixon's factorization method in simple terms?

In number theory, Dixon's factorization method (also Dixon's random squares method 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 no…

Why does Dixon's factorization method matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Dixon's factorization method?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Dixon's factorization method.

Tags

  • Integer factorization algorithms
  • Squares in number theory

Keep exploring