home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: sci.math
- Path: sparky!uunet!timbuk.cray.com!walter.cray.com!ferrari!slow
- From: slow@ferrari.cray.com (David Slowinski)
- Subject: checking modular arithmetic
- Message-ID: <1992Dec31.134329.21227@walter.cray.com>
- Lines: 32
- Nntp-Posting-Host: ferrari.cray.com
- Reply-To: slow@ferrari.cray.com (David Slowinski)
- Organization: Cray Research, Inc. Eagan, MN.
- Date: 31 Dec 92 13:43:29 CST
-
- Background:
- For my Mersenne Prime search I use the Lucas-Lehmer test to test
- the primality of 2^p-1:
- 1) u = 4
- 2) for i = 3 to p
- 3) u = u^2 mod 2^p-1 - 2
- 4) next i
- 5) if u == 0 then 2^p-1 is prime
-
- Nearly all of the computer time is spent computing u^2 in line 3.
- My current program uses a Schonhage-Strassen multiply based on
- a mixed-radix FFT microtasked to run in parallel on multi-cpu
- shared memory machines. Since I often make programming errors and
- run on experimental hardware, I use a residue check to verify the
- correctness of each 2p bit long multiply.
- Barry Fagin and Richard Crandall have developed a clever algorithm
- that directly computes the 'u^2 mod 2^p-1' using FFT's on only p bits.
- This algorithm is over twice as fast as the 2p bit FFT multiply that
- I use now. I would like to use this faster algorithm in my new
- mpp based program, but I am afraid to without a check on each
- result to give me confidence.
-
- Question:
- Is there a way to check the correctness of the result of
- 'u^2 mod 2^p-1' where p is prime in the range 500,000 - 1,000,000?
-
- Thank you kindly,
-
- David Slowinski
- slow@cray.com
- Cray Research Inc
- Chippewa Falls, Wisconsin
-