20171229, 00:21  #67  
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2
2745_{16} Posts 
Quote:
Congratulations! You proved that all primes are 2PRP. What is even more impressive is that all composite Mersenne numbers are 2PRPs (even if you don't know it), so your test will just call them all prime. No false negatives! 

20171229, 01:18  #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^71)2.........Modulo Dividend???~125 (should be the dividend "seed" value to get "d", the real Modulo dividend as per the algorithm. #2.......b=2^71...............Modulo Divisor~(a+2=127)....NUMBER UNDER TEST #3.......c=(a+1)/2............Modulo Target Congruant~63 #4.......d=2^a1..............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. 

20171229, 02:18  #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.

20171229, 02:23  #70  
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2
3^{2}·1,117 Posts 
Quote:
Last fiddled with by ewmayer on 20171229 at 04:40 Reason: Ha, ha, nice to see another TIE fan in the house  "I feel like new toothbrush!" 

20171229, 02:35  #71 
If I May
"Chris Halsall"
Sep 2002
Barbados
3·3,691 Posts 

20171229, 04:57  #72  
Feb 2017
245_{8} Posts 
Quote:
I do not understand what you are saying about 2PRP'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^91 & 2^151, 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. 

20171229, 05:54  #73 
Feb 2017
165_{10} Posts 
SAGEMATH CODE for False Positives
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^y1; #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 20171229 at 05:56 Reason: adding semicolon to step 8 of cell 2 
20171229, 06:19  #74 
Feb 2017
3×5×11 Posts 
Restatement of Algorithm for Use and Testing
If (2^n1) mod (n+2) = (n+1)/2, then (n+2) is PRIME, else COMPOSITE, n being an element of the set of positive integers =>1

20171229, 06:41  #75 
∂^{2}ω=0
Sep 2002
República de California
5·2,351 Posts 

20171229, 06:45  #76  
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2
3^{2}·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^n1) 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^n1) mod (n+2) = (n+1)/2, then (n+2) is PRIME? Wrong. It is composite. Try n+2 == 645. (2^n1) mod (n+2) = (n+1)/2, then (n+2) is PRIME? Wrong. It is composite. 

20171229, 06:49  #77 
If I May
"Chris Halsall"
Sep 2002
Barbados
3·3,691 Posts 

Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
gpuOwL: an OpenCL program for Mersenne primality testing  preda  GpuOwl  2908  20230130 01:25 
GQQ: a "deterministic" "primality" test in O(ln n)^2  Chair Zhuang  Miscellaneous Math  21  20180326 22:33 
AouessareEl HaddouchiEssaaidi "test": "if Mp has no factor, it is prime!"  wildrabbitt  Miscellaneous Math  11  20150306 08:17 
"New primality proving test from Alex Petrov"  ewmayer  Math  11  20070423 19:07 
P1 B1/B2 selection with "Test=" vs "Pfactor="  James Heinrich  Software  2  20050319 21:58 