![]() |
|
|
#1 |
|
Einyen
Dec 2003
Denmark
1100010101102 Posts |
Charles Greathouse showed me this formula for the number of "Non-Witnesses" / "False Witnesses" for composite numbers in the Rabin-Miller strong PRP test:
https://oeis.org/A141768 Code:
(PARI) star(n)={n--; n>>valuation(n, 2)};
bases(n)={my(f=factor(n)[, 1], nu=valuation(f[1]-1, 2), nn = star(n)); for(i=2, #f, nu = min(nu, valuation(f[i] - 1, 2)); ); (1 + (2^(#f * nu) - 1) / (2^#f - 1)) * prod(i=1, #f, gcd(nn, star(f[i]))) - 1};
r=0; forstep(n=9, 1e8, 2, if(isprime(n), next); t=bases(n); if(t>r, r=t; print1(n", ")))
I'll start by explaining the formula: We have an odd composite number n with a prime factorization: Each prime factor can be written as: The composite n can also be written in this way: Now the number of non-witnesses, which I call NW and which includes 1 and n-1 as non-witnesses, is given by: I was investigating the different "types" of non-witnesses of Type A: If an integer a is type A, then n-a is type B and vice versa, so there is an equal number of A and B. If a is type C,D,E,... then n-a is the same type, so the number of each type is always even. I found out that the formula actually gives the number of each "type" of non-witnesses. This is only from my numerical testing and is not proved in any way. If I divide the polynomials in the formula it can be written as: where The first 2 prod is the number of type A and B, and prod*2k is the number of type C, prod*22*k type D and so on. Note that there is only any type C if rmin>=2, type D if rmin>=3 and so on. I tested this for all odd composites up to 400,000 so far and it checks out, and of those 166,140 odd composites < 400,000: 17315 had rmin=2, 1545 had rmin=3, 541 had rmin=4, 53 had rmin=5, 19 had rmin=6, 3 had rmin=7, 2 had rmin=8. Last fiddled with by ATH on 2011-07-30 at 16:44 |
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Probabilistic primality tests faster than Miller Rabin? | mathPuzzles | Math | 14 | 2017-03-27 04:00 |
| Miller-Rabin test questions | firejuggler | Miscellaneous Math | 6 | 2011-12-22 05:57 |
| Miller-Rabin Strong Probable Prime Test (SPRP) | fenderbender | Miscellaneous Math | 22 | 2010-11-11 01:04 |
| Monier-Rabin Theorem | flouran | Math | 2 | 2009-05-01 21:44 |
| Why no Rabin-Miller Tests ? | Axel Fox | Math | 13 | 2004-06-28 16:07 |