Re: [math-fun] formulas for producing primes
1 Jan
2019
1 Jan
'19
1:51 p.m.
OEIS joke: 1,2,3,5,6,7,8,9,10,11,12,13,... Prime or Mod[Gamma@n,n]==0. (Every n>0 except 4.) On 2018-12-31 15:18, D J Makin via math-fun wrote:
Well the simplest math expression to test if n is prime I’d guess is that n is prime if (gamma(n)^2)%n is not zero ;) I tested this using the mathematically simpler and smaller (but somewhat slower?) ((n-1)!*p!)%n where p! is the product of the primes less than n and with the exact equivalent to the gamma version ((n-1)!^2)%n. Not much use for huge primes without an incredibly fast and incredibly accurate method of evaluating the gamma function.
2516
Age (days ago)
2516
Last active (days ago)
0 comments
1 participants
participants (1)
-
Bill Gosper