Rational sieve

Rational sieve

In mathematics, the rational sieve is a general algorithm for factoring integers into prime factors. It is essentially a special case of the general number field sieve, and while it is far less efficient than the general algorithm, it is conceptually far simpler. So while it is rather useless as a practical factoring algorithm, it is a helpful first step for those trying to understand how the general number field sieve works.

Method

Suppose we are trying to factor the composite number "n". We choose a bound "B", and identify the "factor base" (which we will call "P") consisting of all primes smaller than "B". Next, we search for positive integers "z" such that both "z" and "z+n" are "B"-smooth -- i.e. all of their prime factors are less than or equal to "B". We can therefore write, for suitable a_k,

z=prod_{p_iin P} p_i^{a_i}

and likewise, for suitable b_k, we have

z+n=prod_{p_iin P} p_i^{b_i}.

But z and z+n are congruent modulo n, and so each such integer "z" that we find yields a multiplicativerelation (mod "n") among the elements of "P", i.e.

:prod_{p_iin P} p_i^{a_i} equiv prod_{p_iin P} p_i^{b_i} ; operatorname{(mod} ; n operatorname{)}

(where the "ai" and "bi" are nonnegative integers.)

When we have generated enough of these relations (it's generally sufficient that the number of relations be a few more than the size of "P"), we can use the methods of linear algebra 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 a2≡b2 (mod "n"), which can be turned into a factorization of "n", "n"=gcd("a"-"b","n")×gcd("a"+"b","n"). This factorization might turn out to be trivial (i.e. "n"="n"×1), in which case we have to try again with a different combination of relations; but with luck we will get a nontrivial factorization of "n", and the algorithm will terminate.

Example

We will factor the integer "n" = 35 using the rational sieve. We'll arbitrarily try the value "B"=19, giving the factor base "P"={2,3,11,13,17,19}. (We cannot include 5 and 7 since they are actually factors of 35, which renders the algorithm unusable. Of course, if we already know the factors, we do not need to do the algorithm, but we will anyway to show that the algorithm works, i.e. for demonstration purposes.) Next, we search for values of "z" -- the first few are 1, 3, 4, 9, 13, 19, and 22, and we can stop there. The seven values of "z" give seven multiplicative relations (mod 35):

*2030110130190 = 1 ≡ 36 = 2232110130190.............(1)

*2031110130190 = 3 ≡ 38 = 2130110130191.............(2)

*2230110130190 = 4 ≡ 39 = 2031110131190.............(3)

*2032110130190 = 9 ≡ 44 = 2230111130190.............(4)

*2030110131190 = 13 ≡ 48 = 2431110130190.............(5)

*2030110130191 = 19 ≡ 54 = 2133110130190.............(6)

*2130111130190 = 22 ≡ 57 = 2031110130191.............(7)

There are now several essentially different ways to combine these and end up with even exponents:

*(2)×(4)×(7): After multiplying these and canceling out common factors (which we can do since they are coprime with "n"), [Note that common factors cannot "in general" be canceled in a congruence, but they can "in this case", since the primes of the factor base are all required to be coprime to "n", as mentioned above. See modular multiplicative inverse.] this reduces to 32 ≡ 22192, or 32 ≡ 382. The resulting factorization is 35 = gcd(38-3,35) × gcd(38+3,35) = 35×1. The trivial factorization; try again.

*(1): This says 62 ≡ 12, which gives the factorization 35 = gcd(6-1,35) × gcd(6+1,35) = 5×7. Success!

Note that there were still other combinations we did not need to use, such as (3)×(5) and (2)×(6).

Limitations of the algorithm

The rational sieve, like the general number field sieve, cannot factor numbers of the form "pm", where "p" is a prime and "m" 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.

The bigger problem is finding a sufficient number of "z" such that both "z" and "z"+"n" are "B"-smooth. For any given "B", the proportion of numbers that are "B"-smooth decreases rapidly with the size of the number. So if "n" is large (say, a hundred digits), it will be difficult or impossible to find enough "z" for the algorithm to work. The advantage of the general number field sieve is that one need only search for smooth numbers of order "n"1/"d" for some positive integer "d" (typically 3 or 5), rather than of order "n" as required here.

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. A draft is available at [http://www.std.org/~msm/common/f9paper.ps www.std.org/~msm/common/f9paper.ps] .

*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


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Sieve of Eratosthenes — Sieve of Eratosthenes: algorithm steps for primes below 121 (including optimization of starting from prime s square). In mathematics, the sieve of Eratosthenes (Greek: κόσκινον Ἐρατοσθένους), one of a number of prime number sieves, is a simple,… …   Wikipedia

  • General number field sieve — In number theory, the general number field sieve (GNFS) is the most efficient classical algorithm known for factoring integers larger than 100 digits. Heuristically, its complexity for factoring an integer n (consisting of log2 n bits) is of …   Wikipedia

  • Special number field sieve — The special number field sieve (SNFS) is a special purpose integer factorization algorithm. The general number field sieve (GNFS) was derived from it.The special number field sieve is efficient for integers of the form r e plusmn; s , where r and …   Wikipedia

  • Quadratic sieve — The quadratic sieve algorithm (QS) is a modern integer factorization algorithm and, in practice, the second fastest method known (after the general number field sieve). It is still the fastest for integers under 100 decimal digits or so, and is… …   Wikipedia

  • Large sieve — In mathematics, the large sieve is a method of analytic number theory. As the name implies, it was developed in sieve theory, (for example) sifting from an integer sequence by means of congruence conditions modulo prime numbers in which a… …   Wikipedia

  • Computational number theory — In mathematics, computational number theory, also known as algorithmic number theory, is the study of algorithms for performing number theoretic computations. The best known problem in the field is integer factorization. See also Computational… …   Wikipedia

  • Chakravala method — The chakravala method (Hindi: चक्रवाल विधि) is a cyclic algorithm to solve indeterminate quadratic equations, including Pell s equation. It is commonly attributed to Bhāskara II, (c. 1114 – 1185 CE)[1][2] although some attribute it to Jayadeva (c …   Wikipedia

  • List of mathematics articles (R) — NOTOC R R. A. Fisher Lectureship Rabdology Rabin automaton Rabin signature algorithm Rabinovich Fabrikant equations Rabinowitsch trick Racah polynomials Racah W coefficient Racetrack (game) Racks and quandles Radar chart Rademacher complexity… …   Wikipedia

  • Multiplication algorithm — A multiplication algorithm is an algorithm (or method) to multiply two numbers. Depending on the size of the numbers, different algorithms are in use. Efficient multiplication algorithms have existed since the advent of the decimal system.… …   Wikipedia

  • Discrete logarithm — In mathematics, specifically in abstract algebra and its applications, discrete logarithms are group theoretic analogues of ordinary logarithms. In particular, an ordinary logarithm loga(b) is a solution of the equation ax = b over the… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”