HOME

TheInfoList



OR:

In
mathematics Mathematics is a field of study that discovers and organizes methods, Mathematical theory, theories and theorems that are developed and Mathematical proof, proved for the needs of empirical sciences and mathematics itself. There are many ar ...
, the rational sieve is a general
algorithm In mathematics and computer science, an algorithm () is a finite sequence of Rigour#Mathematics, mathematically rigorous instructions, typically used to solve a class of specific Computational problem, problems or to perform a computation. Algo ...
for factoring integers into prime factors. It is a special case of the general number field sieve. While it is less efficient than the general algorithm, it is conceptually simpler. It serves as a helpful first step in understanding how the general number field sieve works.


Method

Suppose we are trying to factor the
composite number A composite number is a positive integer that can be formed by multiplying two smaller positive integers. Accordingly it is a positive integer that has at least one divisor other than 1 and itself. Every positive integer is composite, prime numb ...
. We choose a bound ', and identify the '' factor base'' (which we will call ), the set of all primes less than or equal to '. Next, we search for positive integers such that both ' and are '- smooth — i.e. all of their prime factors are in '. We can therefore write, for suitable exponents and , z=\prod_ p_i^ \qquad \text \qquad z+n=\prod_ p_i^. But and z+n are congruent modulo , and so each such integer that we find yields a multiplicative relation (mod ) among the elements of ', i.e. :\prod_ p_i^ \equiv \prod_ p_i^ \pmod n (where the and are nonnegative integers.) When we have generated enough of these relations (it is generally sufficient that the number of relations be a few more than the size of '), we can use the methods of
linear algebra Linear algebra is the branch of mathematics concerning linear equations such as :a_1x_1+\cdots +a_nx_n=b, linear maps such as :(x_1, \ldots, x_n) \mapsto a_1x_1+\cdots +a_nx_n, and their representations in vector spaces and through matrix (mathemat ...
to multiply together these various relations in such a way that the exponents of the primes are all even. This will give us a congruence of squares of the form , which can be turned into a factorization of . This factorization might turn out to be trivial (i.e. ), in which case we have to try again with a different combination of relations, but with luck we will get a nontrivial pair of factors of , and the algorithm will terminate.


Example

We will factor the integer using the rational sieve. We will arbitrarily try the value , giving the factor base . The first step is to test for divisibility by each of the members of ; clearly if is divisible by one of these primes, then we are finished already. However, 187 is not divisible by 2, 3, 5, or 7. Next, we search for suitable values of ; the first few are 2, 5, 9, and 56. These four suitable values of give four multiplicative relations (mod 187): There are now several essentially different ways to combine these and end up with even exponents. For example, *()×(): After multiplying these and canceling out the common factor of 7 (which we can do since 7, being a member of ', has already been determined to be coprime with ), this reduces to . The resulting factorization is . Alternatively, equation () is in the proper form already: *(): This says , which gives the factorization .


Limitations of the algorithm

Like the general number field sieve, the rational sieve cannot factor numbers of the form , where is a prime and is an integer. This is not a huge problem, though—such numbers are statistically rare, and moreover there is a simple and fast process to check whether a given number is of this form. Probably the most elegant method is to check whether holds for any using an integer version of
Newton's method In numerical analysis, the Newton–Raphson method, also known simply as Newton's method, named after Isaac Newton and Joseph Raphson, is a root-finding algorithm which produces successively better approximations to the roots (or zeroes) of a ...
for the root extraction. The biggest problem is finding a sufficient number of ' such that both ' and are -smooth. For any given ', the proportion of numbers that are '-smooth decreases rapidly with the size of the number. So if is large (say, a hundred digits), it will be difficult or impossible to find enough ' for the algorithm to work. The advantage of the general number field sieve is that one only needs to search for smooth numbers of order for some , rather than of order as required here.A. K. Lenstra, H. W. Lenstra, Jr., M. S. Manasse, and J. M. Pollard, ''The Factorization of the Ninth Fermat Number,'' Math. Comp. 61 (1993), p. 328


References

*A. K. Lenstra, H. W. Lenstra, Jr., M. S. Manasse, and J. M. Pollard, ''The Factorization of the Ninth Fermat Number,'' Math. Comp. 61 (1993), 319-349. Available a

*A. K. Lenstra, H. W. Lenstra, Jr. (eds.) ''The Development of the Number Field Sieve,'' Lecture Notes in Mathematics 1554, Springer-Verlag, New York, 1993.


Footnotes

{{DEFAULTSORT:Rational Sieve Integer factorization algorithms