![]() |
![]() |
#67 | |
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2
274516 Posts |
![]() Quote:
Congratulations! You proved that all primes are 2-PRP. What is even more impressive is that all composite Mersenne numbers are 2-PRPs (even if you don't know it), so your test will just call them all prime. No false negatives! |
|
![]() |
![]() |
![]() |
#68 | |
Feb 2017
3·5·11 Posts |
![]() Quote:
That is how I coded the algorithm (in SAGE)....if you like I could(should?) have coded the algorithm as follows as well -I did the above to put the "number" being tested as step #1. #1.......a=(2^7-1)-2.........Modulo Dividend???~125 (should be the dividend "seed" value to get "d", the real Modulo dividend as per the algorithm. #2.......b=2^7-1...............Modulo Divisor~(a+2=127)....NUMBER UNDER TEST #3.......c=(a+1)/2............Modulo Target Congruant~63 #4.......d=2^a-1..............Modulo Divident~ As above #5.......e=d mod a..........Algorithm Congruant=63 #6.......c==e....................True~127(Divisor) is Prime To simplify further you could simply call the Divident seed 25 in step #1. That would make the divisor in step #2, 27~(n+2). or (a+2) if you like. I only used mersenne notation because jnml was working with Mn notation, which would be more practical if very large numbers are to be considered. I am trying my best to be clear, but bear with me that I am trying to translate my code into words. I will try to type some actual code of a working page as I code the algorithm in SAGEMATH. But everybody would code differently depending on their expertise in SAGEMATH. My coding skills in SAGE are moderate. |
|
![]() |
![]() |
![]() |
#69 |
∂2ω=0
Sep 2002
República de California
5×2,351 Posts |
![]()
No true negatives, either - but hey, who needs all that negativity, it's harshing the holiday spirit, and stuff.
|
![]() |
![]() |
![]() |
#70 | |
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2
32·1,117 Posts |
![]() Quote:
Last fiddled with by ewmayer on 2017-12-29 at 04:40 Reason: Ha, ha, nice to see another TIE fan in the house - "I feel like new toothbrush!" |
|
![]() |
![]() |
![]() |
#71 |
If I May
"Chris Halsall"
Sep 2002
Barbados
3·3,691 Posts |
![]() |
![]() |
![]() |
![]() |
#72 | |
Feb 2017
2458 Posts |
![]() Quote:
I do not understand what you are saying about 2-PRP's ....are you running the algorithm? What are your results? I do not get all "composite mersenne numbers" to be false positives, on the contrary, e.g 2^9-1 & 2^15-1, do not register as a false positives but as composite in the algorithm. Please post your results, you could even do the calculation on a calculator or Excel at this level of magnitude. |
|
![]() |
![]() |
![]() |
#73 |
Feb 2017
16510 Posts |
![]()
Here is SAGEMATH code to check for false positive (prime) results (for the algorithm) up to 1,000,000. Should only take a few minutes to run.
[1] x=0 [2] for y in range(1,1000000,2): z= next_prime(y) a= y+2; #Modulo Divisor....Number under test b= 2^y-1; #Modulo Dividend c= b%a; #Algorithm Modulo Congruent d= (y+1)/2; #Target Congruent as per Algorithm if c==d: if z>a: x=x+1 print(a,x); # 'a' is the False Positive identified, 'x' is a counter The SAGEMATH software will automatically do the indentation for the code. Last fiddled with by gophne on 2017-12-29 at 05:56 Reason: adding semi-colon to step 8 of cell 2 |
![]() |
![]() |
![]() |
#74 |
Feb 2017
3×5×11 Posts |
![]()
If (2^n-1) mod (n+2) = (n+1)/2, then (n+2) is PRIME, else COMPOSITE, n being an element of the set of positive integers =>1
|
![]() |
![]() |
![]() |
#75 |
∂2ω=0
Sep 2002
República de California
5·2,351 Posts |
![]() |
![]() |
![]() |
![]() |
#76 | |
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2
32·1,117 Posts |
![]()
A person who walks off a 1km cliff also doesn't understand that he is already dead.
But he is. Quote:
Try n+2 == 341. (2^n-1) mod (n+2) = (n+1)/2, then (n+2) is PRIME? Wrong. It is composite. F. Sarrus in 1820 found 341 as one of the first pseudoprimes, to base 2. That was 197 years ago. Try n+2 == 561. (2^n-1) mod (n+2) = (n+1)/2, then (n+2) is PRIME? Wrong. It is composite. Try n+2 == 645. (2^n-1) mod (n+2) = (n+1)/2, then (n+2) is PRIME? Wrong. It is composite. |
|
![]() |
![]() |
![]() |
#77 |
If I May
"Chris Halsall"
Sep 2002
Barbados
3·3,691 Posts |
![]() |
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
gpuOwL: an OpenCL program for Mersenne primality testing | preda | GpuOwl | 2908 | 2023-01-30 01:25 |
GQQ: a "deterministic" "primality" test in O(ln n)^2 | Chair Zhuang | Miscellaneous Math | 21 | 2018-03-26 22:33 |
Aouessare-El Haddouchi-Essaaidi "test": "if Mp has no factor, it is prime!" | wildrabbitt | Miscellaneous Math | 11 | 2015-03-06 08:17 |
"New primality proving test from Alex Petrov" | ewmayer | Math | 11 | 2007-04-23 19:07 |
P-1 B1/B2 selection with "Test=" vs "Pfactor=" | James Heinrich | Software | 2 | 2005-03-19 21:58 |