![]() |
![]() |
#1 |
Jul 2007
17 Posts |
![]()
From Chris Caldwell's Prime pages (1) (2) , there's a definition of Strong Probable Primes. It matches Wikipedia and a few other googled sources.
But this test doesn't seem to work. Let's test n=7 with the SPRP base a=35. n-1=6, so d=3, s=1. 35^3 mod 7 = 0. This isn't 1, so it fails the first test. (35^3)^2 mod 7 =0. This isn't -1, so it fails the second test. Therefore 7 is not an 35-SPRP. So 7 is not prime. What's the flaw in the logic above? My bad math? Is it just a bad definition which should add some restriction that composite base values a are not allowed? Or another unlisted requirement that a mod n cannot be 0? |
![]() |
![]() |
![]() |
#2 | |
Account Deleted
"Tim Sorbera"
Aug 2006
San Antonio, TX USA
2×3×23×31 Posts |
![]()
35 is a multiple of 7. So of course 35^3 = 0 mod 7, along with any powers of 35^3. Maybe there's a condition that isn't being made clear, that a and p must be coprime, or at least that a can't be a multiple of p.
Composite bases are allowed, though: Quote:
Last fiddled with by Mini-Geek on 2010-11-09 at 02:20 |
|
![]() |
![]() |
![]() |
#3 |
Aug 2006
3×1,993 Posts |
![]()
Generally, you want to choose bases between 2 and p-2, inclusive. You won't run into trouble in this range.
|
![]() |
![]() |
![]() |
#4 |
Jul 2007
17 Posts |
![]()
Thanks for verifying my math!
So the question is actually whether the definition of an SPRP is wrong and needs a special caveat for these cases, or whether it's OK for primes to fail the SPRP test. Should we just say that "n is an a-SPRP" is undefined if n < a+2? Or just say that all values n <=a are an a-SPRP. Both definitions preserve the useful fact that if n is not an a-SPRP, it is composite. |
![]() |
![]() |
![]() |
#5 | |
"Bob Silverman"
Nov 2003
North of Boston
746010 Posts |
![]() Quote:
specify (a,p) = 1. |
|
![]() |
![]() |
![]() |
#6 | |
Account Deleted
"Tim Sorbera"
Aug 2006
San Antonio, TX USA
2×3×23×31 Posts |
![]() Quote:
Last fiddled with by Mini-Geek on 2010-11-09 at 13:27 |
|
![]() |
![]() |
![]() |
#7 | |
"Bob Silverman"
Nov 2003
North of Boston
22×5×373 Posts |
![]() Quote:
Standard number theoretic usage. |
|
![]() |
![]() |
![]() |
#8 |
Account Deleted
"Tim Sorbera"
Aug 2006
San Antonio, TX USA
10000101101102 Posts |
![]()
That doesn't help me. Will you please tell me what it is? Or perhaps, is there a resource that would help me understand standard number theoretic usages when it's not spelled out?
If not, will someone else tell me what he means? Last fiddled with by Mini-Geek on 2010-11-09 at 14:41 |
![]() |
![]() |
![]() |
#9 | |
"Bob Silverman"
Nov 2003
North of Boston
11101001001002 Posts |
![]() Quote:
Numbers. Or any other text on elementary number theory. I can recommend several others if Hardy & Wright is not to your liking. As to why I won't just *give* the answer: Give a man a fish and he eats for a day. Teach a man to fish and he eats for a lifetime. |
|
![]() |
![]() |
![]() |
#10 |
Aug 2006
3×1,993 Posts |
![]() |
![]() |
![]() |
![]() |
#11 | |
Account Deleted
"Tim Sorbera"
Aug 2006
San Antonio, TX USA
427810 Posts |
![]() Quote:
Thanks. |
|
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Probabilistic primality tests faster than Miller Rabin? | mathPuzzles | Math | 14 | 2017-03-27 04:00 |
Hi, how can I test my probable prime number? | mohdosa | Information & Answers | 22 | 2014-10-10 11:34 |
Miller-Rabin test questions | firejuggler | Miscellaneous Math | 6 | 2011-12-22 05:57 |
Number of Rabin-Miller Non-Witnesses | ATH | Math | 0 | 2011-07-30 16:42 |
Why no Rabin-Miller Tests ? | Axel Fox | Math | 13 | 2004-06-28 16:07 |