Re: Pseudo prime tests

2012-06-23 Thread bodrato
Ciao David, Il Ven, 15 Giugno 2012 2:19 am, David Cleaver ha scritto: I would be happy to contribute code to GMP and/or the FSF. Please let me know how best to accomplish this. The first step is: produce a valuable piece of code; the next one is some paperwork (copyright assignments to FSF),

Re: Pseudo prime tests

2012-06-15 Thread David Cleaver
On 6/14/2012 7:41 AM, Torbjorn Granlund wrote: bodrato writes: You mean the BPSW primality test? I wasn't aware of this BPSW suggestion. What I am suggesting is similar, but I am not familiar with the Lucas test. I also think one should do more trial dividing, and let its limits be

Re: Pseudo prime tests

2012-06-14 Thread Torbjorn Granlund
bodr...@mail.dm.unipi.it writes: You mean the BPSW primality test? I wasn't aware of this BPSW suggestion. What I am suggesting is similar, but I am not familiar with the Lucas test. I also think one should do more trial dividing, and let its limits be operand dependent. Some months ago,

Re: Pseudo prime tests

2012-06-14 Thread bodrato
Ciao, Il Gio, 14 Giugno 2012 2:41 pm, Torbjorn Granlund ha scritto: bodr...@mail.dm.unipi.it writes: I wrote a kind of implementation for the Lucas-Selfridge test, it Cool. I suppose I need to read more about the maths to fully admire your work. :-) I plainly implemented the formulas

Re: Pseudo prime tests

2012-06-11 Thread Torbjorn Granlund
bodr...@mail.dm.unipi.it writes: I'd like to keep the Return 2 if n is definitely prime feature of the current _probab_prime_ function. Yes, that would be nice. 2. mpz_notdiv_pprime_p, like mpz_pprime_p but without trial dividing. Do we really need a new function for this? An

Re: Pseudo prime tests

2012-06-11 Thread Torbjorn Granlund
I have read up on this subject. Selfridge and Pomerance have noticed that an M-R test with base 2 plus a Fibonacci test (Fib_n + Legendre(n,5) == 0 (mod n)) seem to correctly identify composite numbers. They will give USD 620 to anyone who finds a composite identified as a prime, or proves that