10.12.2012 Views

Prime Numbers

Prime Numbers

Prime Numbers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

276 Chapter 6 SUBEXPONENTIAL FACTORING ALGORITHMS<br />

B 2 i ≡ n (mod pi) andBi ≡ 0(moda/pi).) If we traverse the 2 k−1 numbers<br />

B1 ± B2 ± ...± Bk using a Gray code and precompute the lists 2Bia −1 mod p<br />

for all p with which we sieve, then we can move from the sieving coordinates<br />

for one polynomial to the next doing merely some low-precision adds and<br />

subtracts for each p. One can get by with storing only the most frequently<br />

used files 2Bia −1 mod a if space is at a premium. For example, storing this<br />

file only for i = k, which is in action every second step in the Gray code,<br />

we have initialization being very cheap half the time, and done with a single<br />

modular multiplication for each p (and a few adds and subtracts) the other<br />

half of the time.<br />

The idea for self initialization was briefly sketched in [Pomerance et al.<br />

1988] and more fully described in [Alford and Pomerance 1995] and [Peralta<br />

1993]. In [Contini 1997] it is shown through some experiments that self<br />

initialization gives about a twofold speedup over standard implementations<br />

of QS using multiple polynomials.<br />

6.1.7 Zhang’s special quadratic sieve<br />

What makes the quadratic sieve fast is that we have a polynomial progression<br />

of small quadratic residues. That they are quadratic residues renders them<br />

useful for obtaining congruent squares that can split n. That they form a<br />

polynomial progression (that is, consecutive values of a polynomial) makes<br />

it easy to discover smooth values, namely, via a sieve. And of course, that<br />

they are small makes them more likely to be smooth than random residues<br />

modulo n. One possible way to improve this method is to find a polynomial<br />

progression of even smaller quadratic residues. Recently, M. Zhang has found<br />

such a way, but only for special values of n, [Zhang 1998]. We call his method<br />

the special quadratic sieve, or SQS.<br />

Suppose the number n we are trying to factor (which is odd, composite,<br />

and not a power) can be represented as<br />

n = m 3 + a2m 2 + a1m + a0, (6.4)<br />

where m, a2,a1,a0 are integers, m ≈ n 1/3 .Actually,everynumbern can be<br />

represented in this way; just choose m = n 1/3 ,leta1 = a2 =0,andlet<br />

a0 = n − m 3 . We shall see below, though, that the representation (6.4) will<br />

be useful only when the ai’s are all small in absolute value, and so we are<br />

considering only special values of n.<br />

Let b0,b1,b2 be integer variables, and let<br />

where m is as in (6.4). Since<br />

we have<br />

x = b2m 2 + b1m + b0,<br />

m 3 ≡−a2m 2 − a1m − a0 (mod n),<br />

m 4 ≡ (a 2 2 − a1)m 2 +(a1a2 − a0)m + a0a2 (mod n),<br />

x 2 ≡ c2m 2 + c1m + c0 (mod n), (6.5)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!