Previous, Math 511 Home, Contents, Unit Exam

Implementing the Quadratic Sieve

To factor 629287, we start by considering only 29-smooth numbers. We first look at the polynomial Q(x) = x2 - 629287. In order for a prime p to divide a value of Q(x), it is necessary that x2 = 629287 (mod p). We compute

Mod 629287 Roots
2 1 1
3 1 1, 2
5 2 None
7 1 1, 6
11 10 None
13 9 3, 10
17 15 7, 10
19 7 8, 11
23 7 None
29 16 4, 25

Now we look at values of x from 783 to 802 (these are values centered about 793.27..., the square root of 629287). We mark which primes divide Q(x) for each value of x

x 2 3 5 7 11 13 17 19 23 29
783 X X X
784 X
785 X X X
786
787 X X X X
788 X
789 X X
790 X X X X
791 X X
792 X X
793 X X
794 X
795 X
796 X X
797 X X X
798
799 X X X
800 X
801 X
802 X

Now we try to factor Q(x) = x2 - 629287 for each value of x, using the table to tell us which primes will factor Q(x). Since most of the entries in the table are blank (81.5% to be precise), we save a lot of work by using the "sieving" methods of building the table to tell us which primes we need to consider. For larger numbers, the savings are even greater (much greater). Finally, after trying the twenty different values of x in the table, we find three 29-smooth values of Q(x).

x     Q(x)     Factorization of Q(x)
787 -9918 -1 ´ 2 ´ 32 ´ 19 ´ 29
790 -5187 -1 ´ 3 ´ 7 ´ 13 ´ 19
792 2023 -1 ´ 7 ´ 172

Next we look at the polynomial Q2(x) = x2 - 2´629287. We repeat the process of finding which primes from 2 to 29 might divide Q2(x) and build a table for values of x from 1111 to 1130 (this range being centered about the square root of 2´629287). Then we go through the process of trying to looking for values of x which give us 29-smooth values for Q2(x). We find two more

x     Q2(x)     Factorization of Q2(x)
1124 4802 2 ´ 74
1130 18326 2 ´ 72 ´ 11 ´ 17

Today (Friday) you are to work together to see how many more 29-smooth values you can find as a class. I will be back on Monday and I’m expecting to see several more values on your list. Good luck.


Please report any problems with this page to bennett@math.ksu.edu
©1998 Andrew G. Bennett