Template:Short description Template:Redirect Template:Unsolved
In mathematics, integer factorization is the decomposition of a positive integer into a product of integers. Every positive integer greater than 1 is either the product of two or more integer factors greater than 1, in which case it is a composite number, or it is not, in which case it is a prime number. For example, Template:Math is a composite number because Template:Math, but Template:Math is a prime number because it cannot be decomposed in this way. If one of the factors is composite, it can in turn be written as a product of smaller factors, for example Template:Math. Continuing this process until every factor is prime is called prime factorization; the result is always unique up to the order of the factors by the prime factorization theorem.
To factorize a small integer Template:Mvar using mental or pen-and-paper arithmetic, the simplest method is trial division: checking if the number is divisible by prime numbers Template:Math, Template:Math, Template:Math, and so on, up to the square root of Template:Mvar. For larger numbers, especially when using a computer, various more sophisticated factorization algorithms are more efficient. A prime factorization algorithm typically involves testing whether each factor is prime each time a factor is found.
When the numbers are sufficiently large, no efficient non-quantum integer factorization algorithm is known. However, it has not been proven that such an algorithm does not exist. The presumed difficulty of this problem is important for the algorithms used in cryptography such as RSA public-key encryption and the RSA digital signature.<ref>Template:Citation</ref> Many areas of mathematics and computer science have been brought to bear on this problem, including elliptic curves, algebraic number theory, and quantum computing.
Not all numbers of a given length are equally hard to factor. The hardest instances of these problems (for currently known techniques) are semiprimes, the product of two prime numbers. When they are both large, for instance more than two thousand bits long, randomly chosen, and about the same size (but not too close, for example, to avoid efficient factorization by Fermat's factorization method), even the fastest prime factorization algorithms on the fastest classical computers can take enough time to make the search impractical; that is, as the number of digits of the integer being factored increases, the number of operations required to perform the factorization on any classical computer increases drastically.
Many cryptographic protocols are based on the presumed difficulty of factoring large composite integers or a related problem Template:Ndashfor example, the RSA problem. An algorithm that efficiently factors an arbitrary integer would render RSA-based public-key cryptography insecure.
Prime decompositionEdit
By the fundamental theorem of arithmetic, every positive integer has a unique prime factorization. (By convention, 1 is the empty product.) Testing whether the integer is prime can be done in polynomial time, for example, by the AKS primality test. If composite, however, the polynomial time tests give no insight into how to obtain the factors.
Given a general algorithm for integer factorization, any integer can be factored into its constituent prime factors by repeated application of this algorithm. The situation is more complicated with special-purpose factorization algorithms, whose benefits may not be realized as well or even at all with the factors produced during decomposition. For example, if Template:Math where Template:Math are very large primes, trial division will quickly produce the factors 3 and 19 but will take Template:Math divisions to find the next factor. As a contrasting example, if Template:Math is the product of the primes Template:Math, Template:Math, and Template:Math, where Template:Math, Fermat's factorization method will begin with Template:Math which immediately yields Template:Math and hence the factors Template:Math and Template:Math. While these are easily recognized as composite and prime respectively, Fermat's method will take much longer to factor the composite number because the starting value of Template:Math for Template:Math is a factor of 10 from Template:Math.
Current state of the artEdit
Among the Template:Math-bit numbers, the most difficult to factor in practice using existing algorithms are those semiprimes whose factors are of similar size. For this reason, these are the integers used in cryptographic applications.
In 2019, a 240-digit (795-bit) number (RSA-240) was factored by a team of researchers including Paul Zimmermann, utilizing approximately 900 core-years of computing power.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> These researchers estimated that a 1024-bit RSA modulus would take about 500 times as long.<ref name=rsa768>Template:Cite conference</ref>
The largest such semiprime yet factored was RSA-250, an 829-bit number with 250 decimal digits, in February 2020. The total computation time was roughly 2700 core-years of computing using Intel Xeon Gold 6130 at 2.1 GHz. Like all recent factorization records, this factorization was completed with a highly optimized implementation of the general number field sieve run on hundreds of machines.
Time complexityEdit
No algorithm has been published that can factor all integers in polynomial time, that is, that can factor a Template:Math-bit number Template:Math in time Template:Math for some constant Template:Math. Neither the existence nor non-existence of such algorithms has been proved, but it is generally suspected that they do not exist.<ref>Template:Citation</ref><ref>Template:Citation</ref>
There are published algorithms that are faster than Template:Math for all positive Template:Math, that is, sub-exponential. Template:As of, the algorithm with best theoretical asymptotic running time is the general number field sieve (GNFS), first published in 1993,<ref>Template:Cite book</ref> running on a Template:Math-bit number Template:Math in time:
- <math>\exp\left( \left(\left(\tfrac83\right)^\frac23 + o(1)\right)\left(\log n\right)^\frac13\left(\log \log n\right)^\frac23\right).</math>
For current computers, GNFS is the best published algorithm for large Template:Math (more than about 400 bits). For a quantum computer, however, Peter Shor discovered an algorithm in 1994 that solves it in polynomial time. Shor's algorithm takes only Template:Math time and Template:Math space on Template:Math-bit number inputs. In 2001, Shor's algorithm was implemented for the first time, by using NMR techniques on molecules that provide seven qubits.<ref> Template:Cite journal</ref>
In order to talk about complexity classes such as P, NP, and co-NP, the problem has to be stated as a decision problem.
It is known to be in both NP and co-NP, meaning that both "yes" and "no" answers can be verified in polynomial time. An answer of "yes" can be certified by exhibiting a factorization Template:Math with Template:Math. An answer of "no" can be certified by exhibiting the factorization of Template:Math into distinct primes, all larger than Template:Math; one can verify their primality using the AKS primality test, and then multiply them to obtain Template:Math. The fundamental theorem of arithmetic guarantees that there is only one possible string of increasing primes that will be accepted, which shows that the problem is in both UP and co-UP.<ref> {{#invoke:citation/CS1|citation |CitationClass=web }}</ref> It is known to be in BQP because of Shor's algorithm.
The problem is suspected to be outside all three of the complexity classes P, NP-complete,<ref>Template:Citation. See in particular p. 583.</ref> and co-NP-complete. It is therefore a candidate for the NP-intermediate complexity class.
In contrast, the decision problem "Is Template:Math a composite number?" (or equivalently: "Is Template:Math a prime number?") appears to be much easier than the problem of specifying factors of Template:Math. The composite/prime problem can be solved in polynomial time (in the number Template:Math of digits of Template:Math) with the AKS primality test. In addition, there are several probabilistic algorithms that can test primality very quickly in practice if one is willing to accept a vanishingly small possibility of error. The ease of primality testing is a crucial part of the RSA algorithm, as it is necessary to find large prime numbers to start with.
Factoring algorithmsEdit
Special-purposeEdit
A special-purpose factoring algorithm's running time depends on the properties of the number to be factored or on one of its unknown factors: size, special form, etc. The parameters which determine the running time vary among algorithms.
An important subclass of special-purpose factoring algorithms is the Category 1 or First Category algorithms, whose running time depends on the size of smallest prime factor. Given an integer of unknown form, these methods are usually applied before general-purpose methods to remove small factors.<ref name="Bressoud and Wagon"> Template:Cite book</ref> For example, naive trial division is a Category 1 algorithm.
- Trial division
- Wheel factorization
- Pollard's rho algorithm, which has two common flavors to identify group cycles: one by Floyd and one by Brent.
- Algebraic-group factorization algorithms, among which are [[Pollard's p − 1 algorithm|Pollard's Template:Math algorithm]], [[Williams' p + 1 algorithm|Williams' Template:Math algorithm]], and Lenstra elliptic curve factorization
- Fermat's factorization method
- Euler's factorization method
- Special number field sieve
- Difference of two squares
General-purposeEdit
A general-purpose factoring algorithm, also known as a Category 2, Second Category, or Kraitchik family algorithm,<ref name="Bressoud and Wagon"/> has a running time which depends solely on the size of the integer to be factored. This is the type of algorithm used to factor RSA numbers. Most general-purpose factoring algorithms are based on the congruence of squares method.
- Dixon's factorization method
- Continued fraction factorization (CFRAC)
- Quadratic sieve
- Rational sieve
- General number field sieve
- Shanks's square forms factorization (SQUFOF)
Other notable algorithmsEdit
- Shor's algorithm, for quantum computers
Heuristic running timeEdit
In number theory, there are many integer factoring algorithms that heuristically have expected running time
- <math>L_n\left[\tfrac12,1+o(1)\right]=e^{(1+o(1))\sqrt{(\log n)(\log \log n)}}</math>
in little-o and L-notation. Some examples of those algorithms are the elliptic curve method and the quadratic sieve. Another such algorithm is the class group relations method proposed by Schnorr,<ref name=1982-schnorr>Template:Cite journal</ref> Seysen,<ref name=1987-seysen>Template:Cite journal</ref> and Lenstra,<ref name=1988-lenstra >Template:Cite journal</ref> which they proved only assuming the unproved generalized Riemann hypothesis.
Rigorous running timeEdit
The Schnorr–Seysen–Lenstra probabilistic algorithm has been rigorously proven by Lenstra and Pomerance<ref name=lenstra-pomerance/> to have expected running time Template:Math by replacing the GRH assumption with the use of multipliers. The algorithm uses the class group of positive binary quadratic forms of discriminant Template:Math denoted by Template:Math. Template:Math is the set of triples of integers Template:Math in which those integers are relative prime.
Schnorr–Seysen–Lenstra algorithmEdit
Given an integer Template:Mvar that will be factored, where Template:Mvar is an odd positive integer greater than a certain constant. In this factoring algorithm the discriminant Template:Math is chosen as a multiple of Template:Mvar, Template:Math, where Template:Mvar is some positive multiplier. The algorithm expects that for one Template:Mvar there exist enough smooth forms in Template:Math. Lenstra and Pomerance show that the choice of Template:Mvar can be restricted to a small set to guarantee the smoothness result.
Denote by Template:Math the set of all primes Template:Mvar with Kronecker symbol Template:Math. By constructing a set of generators of Template:Math and prime forms Template:Math of Template:Math with Template:Mvar in Template:Math a sequence of relations between the set of generators and Template:Math are produced. The size of Template:Mvar can be bounded by Template:Math for some constant Template:Math.
The relation that will be used is a relation between the product of powers that is equal to the neutral element of Template:Math. These relations will be used to construct a so-called ambiguous form of Template:Math, which is an element of Template:Math of order dividing 2. By calculating the corresponding factorization of Template:Math and by taking a gcd, this ambiguous form provides the complete prime factorization of Template:Mvar. This algorithm has these main steps:
Let Template:Mvar be the number to be factored. Template:Ordered list x^{r(x)}\right).\left(\prod_{q \in P_\Delta} f^{t(q)}_{q}\right) = 1.</math> | Construct an ambiguous form Template:Math that is an element Template:Math of order dividing 2 to obtain a coprime factorization of the largest odd divisor of Template:Math in which Template:Math or Template:Math or Template:Math. | If the ambiguous form provides a factorization of Template:Mvar then stop, otherwise find another ambiguous form until the factorization of Template:Mvar is found. In order to prevent useless ambiguous forms from generating, build up the 2-Sylow group Template:Math of Template:Math. }} To obtain an algorithm for factoring any positive integer, it is necessary to add a few steps to this algorithm such as trial division, and the Jacobi sum test.
Expected running timeEdit
The algorithm as stated is a probabilistic algorithm as it makes random choices. Its expected running time is at most Template:Math.<ref name=lenstra-pomerance>Template:Cite journal</ref>
See alsoEdit
- Aurifeuillean factorization
- Bach's algorithm for generating random numbers with their factorizations
- Canonical representation of a positive integer
- Factorization
- Multiplicative partition
- [[p-adic valuation|Template:Mvar-adic valuation]]
- Integer partition – a way of writing a number as a sum of positive integers.
NotesEdit
ReferencesEdit
- Template:Cite book Chapter 5: Exponential Factoring Algorithms, pp. 191–226. Chapter 6: Subexponential Factoring Algorithms, pp. 227–284. Section 7.4: Elliptic curve method, pp. 301–313.
- Donald Knuth. The Art of Computer Programming, Volume 2: Seminumerical Algorithms, Third Edition. Addison-Wesley, 1997. Template:ISBN. Section 4.5.4: Factoring into Primes, pp. 379–417.
- Template:Cite book.
- Template:Cite book
External linksEdit
- msieve – SIQS and NFS – has helped complete some of the largest public factorizations known
- Richard P. Brent, "Recent Progress and Prospects for Integer Factorisation Algorithms", Computing and Combinatorics", 2000, pp. 3–22. download
- Manindra Agrawal, Neeraj Kayal, Nitin Saxena, "PRIMES is in P." Annals of Mathematics 160(2): 781–793 (2004). August 2005 version PDF
- Eric W. Weisstein, “RSA-640 Factored” MathWorld Headline News, November 8, 2005
- Dario Alpern's Integer factorization calculator – A web app for factoring large integers
Template:Computational hardness assumptions Template:Number theoretic algorithms Template:Divisor classes Template:Authority control