Re: implementing the quadratic sieve
From: rossum (rossum48_at_coldmail.com)
Date: 11/02/04
- Next message: Al MacHonahey: "Re: Not STD C is "not C" ? ----WAS: Re: C to Java Byte Code"
- Previous message: Programmer Dude: "Re: Choosing between C and VB"
- In reply to: Marlene Stebbins: "implementing the quadratic sieve"
- Next in thread: Marlene Stebbins: "Re: implementing the quadratic sieve"
- Reply: Marlene Stebbins: "Re: implementing the quadratic sieve"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 02 Nov 2004 22:02:47 +0000
On Mon, 01 Nov 2004 20:44:45 GMT, Marlene Stebbins <marlene@mail.com>
wrote:
>I am trying to write a toy implementation of the quadratic sieve.
>The following has been gleaned from several sources. If any of you
>are familiar with the quadratic sieve, I would appreciate you looking
>this over and telling me if I've got it right. FYI, I am a 9th grader
>with a very limited math background.
If you want more math background then http://mathworld.wolfram.com/ is
an excellent site. It covers the quadratic sieve at
http://mathworld.wolfram.com/QuadraticSieve.html
>
>Quadratic Sieve factoring algorithm:
>
>to factor n:
>
>1. Select a set of prime numbers called the factor base.
> (Selecting the factor base requires further explanation.)
>
>2. For each integer f close to the square root of n,
> try to factor (f^2)-n(mod n) with the primes in the factor base.
> ("Close to" is defined as an arbitrary range.)
You can save time here by generating the required numbers in order.
By doing this you can just use addition or subtraction in place of
squaring and mod.
Taking 4633 as in your example:
69^2 = 4761 -> 128 mod 4633
70^2 = 4900 -> 267 mod 4633
71^2 = 5041 -> 408 mod 4633
72^2 = 5184 -> 551 mod 4633
73^2 = 5329 -> 696 mod 4633
Given the question "What is the next number in the sequence 128, 267,
408, 551, 696, ..." you should be able to tell by just using addition.
>
>3. If any or all of the primes in the factor base are factors
> of (f^2)-n(mod n), save f.
You might want to look at the concept of "smooth" numbers here
(http://mathworld.wolfram.com/SmoothNumber.html). These are numbers
with no prime factor larger than a given k. Any number with a single
large factor (large defined as greater than k) will not make a square
unless it is multiplied by another number with the same factor.
Unlikely if the factor is large.
>
>4. Choose several of the saved f's such that when their squares
> are multiplied together, the prime factors of the product(mod n)
> all have even exponents.
Given the number of tries you will potentially have to make before
finding a successful match, you need to think of a way to use the
known factorisations of A and B to generate the factorisation of AB
without having to actually factorise AB.
>
>5. Call the product of the f's x.
>
>6. Call the square root of the product of the prime factors y.
>
>7. Then, gcd(x+y, n) and gcd(x-y, n) are factors of n.
>
A word of warning. From your post I can tell your age (9th grade),
your probable sex (Marlene) and your e-mail address. You should be
more cautious about the information that you release onto Usenet. At
the very least you are in danger of receiving a lot of spam e-mails
advertising irrelevant (to you) anatomical enlargements.
rossum
-- The ultimate truth is that there is no Ultimate Truth
- Next message: Al MacHonahey: "Re: Not STD C is "not C" ? ----WAS: Re: C to Java Byte Code"
- Previous message: Programmer Dude: "Re: Choosing between C and VB"
- In reply to: Marlene Stebbins: "implementing the quadratic sieve"
- Next in thread: Marlene Stebbins: "Re: implementing the quadratic sieve"
- Reply: Marlene Stebbins: "Re: implementing the quadratic sieve"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|