home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!wupost!uwm.edu!biosci!agate!linus!linus.mitre.org!gauss!bs
- From: bs@gauss.mitre.org (Robert D. Silverman)
- Newsgroups: sci.math
- Subject: Re: Prime test algorithm
- Message-ID: <1992Nov18.204334.12453@linus.mitre.org>
- Date: 18 Nov 92 20:43:34 GMT
- References: <1992Nov14.154528.17440@husc15.harvard.edu>
- Sender: news@linus.mitre.org (News Service)
- Organization: Research Computer Facility, MITRE Corporation, Bedford, MA
- Lines: 42
- Nntp-Posting-Host: gauss.mitre.org
-
- In article <1992Nov14.154528.17440@husc15.harvard.edu> blom@husc15.harvard.edu writes:
- >Does anyone have C source code for an algorithm to determine whether an
- >enormous number (over 1000 decimal digits) is prime or composite? I have
- >Derive and Mathematica for my 486, but they run slowly on some of my large
- >prime-test problems (546!-1) and I would like to be able to use my VAXstation
- >4000-90. I think I may also be able to compile Fortran, and maybe Pascal. I
- >have the best luck with C programs because they are so portable.
- >
- >Thanks in advance.
- >--Eric Blom
- > Harvard
-
- You are not going to be able to prove 1000+ digit *general* numbers prime on a
- single workstation in a reasonable time, regardless of whether you
- use the Goldwass-Killian-Atkin-Morain elliptic curve method, or the
- Cohen-Lenstra-Bosma cyclotomic ring method.
-
- Do you really need prime proofs? Are you willing to settle for probable
- primes? If you are testing n!+1 or n!-1, once you know it is a prp,
- proving it prime is trivial, because N-1 or N+1 factors readily. In the
- first case you can find a primitive root. In the second, a Lucas-Lehmer
- test will suffice.
-
- Others have already looked at when n!-1, n!+1, n#+1, n#-1 are prime.
- [n# = product of distinct primes up to n] Have you checked the
- literature?
-
- See, for example,
-
- Buhler, Crandall, & Penk
- Primes of the form n!+/- 1 and 2*3*5...p +/- 1
-
- Mathematics of Computation vol. 38, 1982 pp 639-645
-
- Be aware that the computations have been carried much further
- than given in that article by H. Dubner (and others).
-
- --
- Bob Silverman
- These are my opinions and not MITRE's.
- Mitre Corporation, Bedford, MA 01730
- "You can lead a horse's ass to knowledge, but you can't make him think"
-