20160308, 19:57  #1 
"Rashid Naimi"
Oct 2015
Remote to Here/There
2^{3}×241 Posts 
A Theoretical (vs. Proficient/Practical) Deterministic Primality Test
Hi,
Is this list exhaustive? http://primes.utm.edu/prove/ Are there any deterministic primality tests based on factorials or primorials? The following routine is based on my infamous Theorem 1. The following code is restricted by the ability to calculate the factorial and is not particularly fast but is as deterministic as trialdivision (though faster) and can determine a factor if the input is composite. The largest prime I used without making the factorial too large for WDP is: 200000000000027 Any comments are greatly anticipated. You can copy and paste the code in Wolfram Development Platform. Try different prp values and press Shift+Enter to run: Code:
prp=919 ; Print[prp," is PRP is ",PrimeQ[prp]]; squareroot=Floor[Sqrt[prp]]; factorial=squareroot !; a=factorial; b=prp; c=2; While[c>1, c=Mod[a,b]; a=b; b=c; ] If[c==0,Print[prp," is divisible by ",a],Print[prp," is definitely Prime."]] Last fiddled with by a1call on 20160308 at 19:59 
20160308, 20:37  #2  
Sep 2002
Database er0rr
2×1,723 Posts 
Quote:
Quote:


20160308, 20:37  #3 
Aug 2006
2×5×593 Posts 
The list is not nearly exhaustive  there are probably hundreds of methods if you include computationally infeasible approaches.

20160308, 20:38  #4 
Aug 2006
2·5·593 Posts 

20160308, 21:00  #5 
"Rashid Naimi"
Oct 2015
Remote to Here/There
2^{3}·241 Posts 
Thank you for the replies.
Thanks for the Wilson's Theorem Link. 
20160308, 21:04  #6 
"NOT A TROLL"
Mar 2016
California
197 Posts 
I would not recommend using Wilson's theorem to prove large primes. The computations are far to long for anyone to calculate. I would rather go with Fermat's Theorem. I hope someone would come up with a more easier theorem someday.

20160308, 21:13  #7  
Aug 2006
1011100101010_{2} Posts 
Quote:
Has Stirling’s Formula ever been applied, with interesting consequence, to Wilson’s Theorem? 

20160308, 23:18  #10  
"Rashid Naimi"
Oct 2015
Remote to Here/There
2^{3}·241 Posts 
Quote:
Thanks again. 

20160309, 20:08  #11 
"Rashid Naimi"
Oct 2015
Remote to Here/There
2^{3}·241 Posts 
Here is perhaps a more useful application of the OpeningPost concept.
Let p_{1} be: p_{1}=n!p_{0} Then: p_{1} is Prime for all integers n>3 and all Prime numbers p_{0} where p_{1}<n^{2} Here is the verification code in the WDP. You cam create a free account here: https://develop.wolframcloud.com/app/ Start a notebook and copy and paste the code below as "Wolfram language input" and press Shift+Enter to run. Try different n values. Code:
n=19; p0=NextPrime[n !n^2]; p1=n !p0; Print[n,"!",p0,"=",p1," is Prime is ",PrimeQ[p1],"."] This potentially opens up a proof to thousands (and by extension unlimited number) of new primes. Take any factorial n!, find a known prime that if subtracted from the factorial yields a sum smaller than n^{2} and you are guaranteed that the sum is a prime. No other primality test is required. 
Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
How long will it be until MM61 is within practical reach of PRP/primality testing?  Stargate38  Operazione Doppi Mersennes  14  20200129 20:35 
GQQ: a "deterministic" "primality" test in O(ln n)^2  Chair Zhuang  Miscellaneous Math  21  20180326 22:33 
Modifying the Lucas Lehmer Primality Test into a fast test of nothing  Trilo  Miscellaneous Math  25  20180311 23:20 
a new Deterministic primality testing  wsc812  Computer Science & Computational Number Theory  36  20130304 06:25 
maximum theoretical speed of LL test w/o bandwidth limitations?  ixfd64  Hardware  30  20120305 06:16 