![]() |
![]() |
#1 |
466010 Posts |
![]()
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
|
![]() |
![]() |
#2 |
"Nancy"
Aug 2002
Alexandria
1001101000112 Posts |
![]()
Moved to Misc. Math.
Alex |
![]() |
![]() |
![]() |
#3 |
Feb 2006
Denmark
2·5·23 Posts |
![]()
Yes, and only if. This is Wilson's Theorem. It's computationally useless.
|
![]() |
![]() |
![]() |
#4 |
∂2ω=0
Sep 2002
República de California
5·2,351 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? |
![]() |
![]() |
![]() |
#5 |
Feb 2006
5110 Posts |
![]()
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 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 Yep, new kid on the block, beaten by 2000+ old algorithm. -Eivind |
![]() |
![]() |
![]() |
#6 |
"Michael"
Aug 2006
Usually at home
22·3·7 Posts |
![]() |
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Modifying the Lucas Lehmer Primality Test into a fast test of nothing | Trilo | Miscellaneous Math | 25 | 2018-03-11 23:20 |
New Mersenne primality test | Prime95 | Miscellaneous Math | 19 | 2014-08-23 04:18 |
N-1 primality test | Citrix | Math | 3 | 2005-09-19 15:06 |
AKS Primality Test | Guilherme | Math | 2 | 2004-11-26 05:29 |
A primality test for Fermat numbers faster than Pépin's test ? | T.Rex | Math | 0 | 2004-10-26 21:37 |