mersenneforum.org there is another way to test the primality of a no
 Register FAQ Search Today's Posts Mark Forums Read

 2007-07-11, 07:21 #1 shawn   176916 Posts there is another way to test the primality of a no There is another way to test the primality of a no.If n be any number then if (n-1)!+1 is divisible by n then n is a prime number
 2007-07-11, 11:37 #2 akruppa     "Nancy" Aug 2002 Alexandria 1001101000002 Posts Moved to Misc. Math. Alex
2007-07-12, 03:16   #3
Jens K Andersen

Feb 2006
Denmark

2×5×23 Posts

Quote:
 Originally Posted by shawn if (n-1)!+1 is divisible by n then n is a prime number
Yes, and only if. This is Wilson's Theorem. It's computationally useless.

 2007-07-12, 15:54 #4 ewmayer ∂2ω=0     Sep 2002 República de California 983710 Posts And the 2007 mfgoode Memorial Bronze Medal in Number Theory goes to the Thread Author, "For seminal work in the area of improved algorithmic efficiency in primality testing." Shawn, PM me your snail-mail address and I'll send you your Medal, and even throw in a free handy-dandy neck-hanger thingie, "just like the Olympic athletes get." I'm thinking we should award some MMBMNTs retroactively, seeing as the prize was only just established this year and the forum goes back a few years. Nominations for 2006? Bearnol, perhaps?
 2007-07-17, 10:18 #5 Eivind   Feb 2006 3·17 Posts Quick and dirty Lest just make a quick and dirty survey. This code Code: def f(n): a = 1 for i in range (2,n+1): a = a*i return a for i in range (2,3000): if (f(i-1)+1)%i == 0: print i Takes about 15 sec. to finish and this code (can I make the sieve more dirty than this Code: for n in range(2, 3000): for x in range(2, n): if n % x == 0: break else: print n Takes less than 2 sec. Yep, new kid on the block, beaten by 2000+ old algorithm. -Eivind
2007-07-17, 17:55   #6
mgb

"Michael"
Aug 2006
Usually at home

24×5 Posts

Quote:
 Originally Posted by shawn If n be any number then if (n-1)!+1 is divisible by n then n is a prime number
I know this conclusion is true but how did you reach it?

 Similar Threads Thread Thread Starter Forum Replies Last Post Trilo Miscellaneous Math 25 2018-03-11 23:20 Prime95 Miscellaneous Math 19 2014-08-23 04:18 Citrix Math 3 2005-09-19 15:06 Guilherme Math 2 2004-11-26 05:29 T.Rex Math 0 2004-10-26 21:37

All times are UTC. The time now is 09:03.

Mon Nov 30 09:03:13 UTC 2020 up 81 days, 6:14, 3 users, load averages: 1.58, 1.27, 1.15