ArticleslgStudy

mathematics

General number field sieve

General number field sieve 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 General number field sieve rather than just read about it. In short: In number theory, the general number field sieve (GNFS) is the most efficient classical algorithm known for factoring integers larger than 10100. Heuristically, its complexity for factoring an integer n (consisting of ⌊log2n⌋+1 bits) is of the form exp⁡(((64/9)1/3+o(1))(log⁡n)1/3(log⁡log⁡n)2/3)=Ln[1/3,(64/9)1/3] in Big-O and L-notations.

Key takeaways

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

Reference excerpt

In number theory, the general number field sieve (GNFS) is the most efficient classical algorithm known for factoring integers larger than 10100. Heuristically, its complexity for factoring an integer n (consisting of ⌊log2n⌋+1 bits) is of the form

exp⁡(((64/9)1/3+o(1))(log⁡n)1/3(log⁡log⁡n)2/3)=Ln[1/3,(64/9)1/3] in Big-O and L-notations. It is a generalization of the special number field sieve: while the latter can only factor numbers of a certain special form (including numbers of the form abn+c with small a and small c, and Fibonacci numbers and Lucas numbers, but not n!±1 or p#±1), the general number field sieve can factor any number apart from prime powers (which are trivial to factor by taking roots). The principle of the number field sieve (both special and general) can be understood as an improvement to the simpler rational sieve or quadratic sieve. When using such algorithms to factor a large number n, it is necessary to search for smooth numbers (i.e. numbers with small prime factors) of order n. The size of these values is exponential in the size of n (see below). The general number field sieve, on the other hand, manages to search for smooth numbers that are subexponential in the size of n. Since these numbers are smaller, they are more likely to be smooth than the numbers inspected in previous algorithms. This is the key to the efficiency of the number field sieve. In order to achieve this speed-up, the number field sieve has to perform computations and factorizations in number fields. This results in many rather complicated aspects of the algorithm, as compared to the simpler rational sieve. The size of the input to the algorithm is log2n or the number of bits in the binary representation of n. Any element of the order nα for a constant α is exponential in log⁡n. The running time of the number field sieve is super-polynomial, but sub-exponential in the size of the input.

Number fields

Suppose f is a k-degree polynomial over ℚ (the rational numbers), and r is a complex root of f. Then, f(r)=0, which can be rearranged to express rk as a linear combination of powers of r less than k. This equation can be used to reduce away any powers of r with exponent at least k. For example, if f(x)=x2+1 and r is the imaginary unit i, then i2+1=0, or i2=−1. This allows us to define the complex product:

(a+bi)(c+di)=ac+(ad+bc)i+(bd)i2=(ac−bd)+(ad+bc)i. In general, this leads directly to the algebraic number field ℚ[r], which can be defined as the set of complex numbers given by:

ak−1rk−1+⋯+a1r1+a0r0, where a0,…,ak−1∈ℚ. The product of any two such values can be computed by taking the product as polynomials, then reducing any powers of r with exponent at least k as described above, yielding a value in the same form. To ensure that this field is actually k-dimensional and does not collapse to an even smaller field, it is sufficient that f is an irreducible polynomial over ℚ. Similarly, one may define the ring of integers 𝕆ℚ[r] as the subset of ℚ[r] which are roots of monic polynomials with integer coefficients. In some cases, this ring of integers is equivalent to the ring ℤ[r]. However, there are many exceptions.

Method

Polynomial choice Two polynomials f(x) and g(x) of small degrees d and d′ are chosen, which have integer coefficients, which are irreducible over the rationals, and which, when interpreted modulo n, have a common integer root m. An optimal strategy for choosing these polynomials is not known; one simple method is to obtain f from the base-m expansion of n for an appropriate choice of m. More precisely: for any choice of m, writing n in base m is, by definition, finding digits a0,a1,…,ad where 0≤ai<m for each i, such that

n=admd+⋯+a1m+a0, which in turn means that m is a root of the polynomial f(x)=adxd+⋯+a1x+a0 modulo n. For the purposes of the general number field sieve, we first fix an appropriate degree d and then perform the above expansion for a number of values m of order n1/d, after which we choose the polynomial f to be the one whose coefficients are overall the smallest among the candidates obtained in this way. We then simply set g(x)=x−m.

Improving polynomial choice The choice of polynomial can dramatically affect the time to complete the remainder of the algorithm. The method of choosing polynomials based on the expansion of n in base m shown above is suboptimal in many practical situations, leading to the development of better methods. One such method was suggested by Murphy and Brent; they introduce a two-part score for polynomials, based on the presence of roots modulo small primes and on the average value that the polynomial takes over the sieving area. The best reported results were achieved by the method of Thorsten Kleinjung, which allows g(x)=ax+b, and searches over a composed of small prime factors congruent to 1 modulo 2d and over leading coefficients of f which are divisible by 60.

Generation of relation pairs (sieving) Consider the number field rings ℤ[r1] and ℤ[r2], where r1 and r2 are roots of the polynomials f and g. Since f is of degree d with integer coefficients, if a and b are integers, then so will be bd⋅f(a/b), which we call r. Similarly, s=bd′⋅g(a/b) is an integer. The goal is to find integer values of a and b that simultaneously make r and s smooth relative to the chosen basis of primes. If a and b are small, then r and s will be small too, about the size of m, and we have a better chance for them to be smooth at the same time. The current best-known approach for this search is lattice sieving; to get acceptable yields, it is necessary to use a large factor base. These pairs are also called relations.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with General number field sieve

Start with the simplest possible case. Write down what General number field sieve 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 General number field sieve 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 General number field sieve 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 General number field sieve

In research
General number field sieve 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 General number field sieve 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
General number field sieve is common in secondary-school and first-year university syllabi. It links to neighbouring topics Integer factorization algorithms, so understanding it makes those chapters shorter.
In everyday life
Look for General number field sieve 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 “General number field sieve” →

How to study General number field sieve in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what General number field sieve 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 General number field sieve out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is General number field sieve in simple terms?

In number theory, the general number field sieve (GNFS) is the most efficient classical algorithm known for factoring integers larger than 10100. Heuristically, its complexity for factoring an integer n (consisting of ⌊log2n⌋+1 bits) is of the form exp⁡(((64/9)1/3+o(1))(log⁡n)1/3(log⁡log⁡n)2/3)=Ln[…

Why does General number field sieve 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 General number field sieve?

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 General number field sieve.

Tags

  • Integer factorization algorithms

Keep exploring