![]() |
|
|
#232 | |
|
May 2010
Prime hunting commission.
168010 Posts |
Quote:
Is that why 1373653 returns as a prime when tested with b=2 or b=3, when the trial division settings are reduced to the point where it passes? Code:
(15:30) gp > isSPRP(1373653, b=2) time = 0 ms. %290 = 1 (15:30) gp > isSPRP(1373653, b=3) time = 0 ms. %291 = 1 Code:
(15:32) gp > isSPRP(390937, b=2) time = 0 ms. %300 = 1 (15:32) gp > isSPRP(390937, b=7) time = 0 ms. %301 = 0 Now that both of those objections are entirely debunked, continuing on with regularly scheduled programming, so to speak. Last fiddled with by 3.14159 on 2010-07-23 at 19:37 |
|
|
|
|
|
|
#233 |
|
Aug 2006
3·1,993 Posts |
|
|
|
|
|
|
#234 | |
|
May 2010
Prime hunting commission.
110100100002 Posts |
Quote:
Code:
isSPRP(n, b=random(n)) = {
forprime(p=2,nextprime(10^6),
if(n%p==0,return(p))
);
my(s=valuation(n-1,2),d=n>>s);
n = Mod(b, n)^d;
if (n == 1, return(n));
while(s--,
if (n == -1, return(n));
n = n^2;
);
n == -1
};
Last fiddled with by 3.14159 on 2010-07-23 at 19:49 |
|
|
|
|
|
|
#235 |
|
Aug 2006
3·1,993 Posts |
In the declaration? (I thought you put it in the Mod() statement, in which case it worked as I described... thus my request for code rather than description.) That's amusing... somewhat inadvisable in general, but it works in this case. Yes, in that case the only problems I have with the documentation is that it doesn't explain return values, and the only problems I have with the code are its inconsistent returns types* and the fact that it may test base 0 or 1. I'm not worried about the latter, though, as long as you use the code only for large numbers.
Last fiddled with by CRGreathouse on 2010-07-23 at 19:57 |
|
|
|
|
|
#236 | |||
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
Quote:
Quote:
Quote:
Also: A lucky find without any modifications: Largest keyjabbed prime I've found: 7242389437701561147346511132232465821 (Passed b= 2, and 5 randoms.) +5 for a keyjabbed prime, +5 for a prime number of digits (37) Last fiddled with by 3.14159 on 2010-07-23 at 19:58 |
|||
|
|
|
|
|
#237 | |
|
Aug 2006
3×1,993 Posts |
It's not self-explanatory to me! The script returns the smallest prime factor of n, if n has a prime factor below 1000033; Mod(1, 1), if n is 1; an error, if n is less than 1; 1, Mod(1, n), or Mod(n-1, n) if none of the preceding apply but n is a base-b probable-prime; 0, if n is a proven composite without known factors.
Quote:
Nice. You can certify primality, if you like, with isprime(N, 1). Last fiddled with by CRGreathouse on 2010-07-23 at 20:00 |
|
|
|
|
|
|
#238 | |||
|
May 2010
Prime hunting commission.
24·3·5·7 Posts |
Quote:
Quote:
Quote:
Last fiddled with by 3.14159 on 2010-07-23 at 20:24 |
|||
|
|
|
|
|
#239 |
|
Aug 2006
3×1,993 Posts |
If the number is small enough to fit into one machine word, it does a special test. If not:
1. Trial divide to 101 (efficiently, not one-at-a-time) 2. Performs a BPSW test (base-2 strong test followed by a Lucas test) 3. If n is less than 10^15, return true (actually, 10^16 would work) 4. Attempt to factor n-1 5. If sufficiently smooth, do a Selfridge n-1 test 6. If almost smooth enough, augment a Selfridge n-1 test with the Brillhart-Lehmer-Selfridge test 7. Otherwise, fall back to APRCL. |
|
|
|
|
|
#240 |
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
Extended my prime search for Proth-GFNs to 150000 for k's range. Also, increased sieving by a factor of 4. This left 1/14 of the candidates.
A curious question: For WinPFGW, there's a bunch of settings like that of its predecessor, PrimeForm. However, they are inaccessible. Why add options such as this, knowing that they are useless because they cannot be accessed? Last fiddled with by 3.14159 on 2010-07-23 at 21:34 |
|
|
|
|
|
#241 | |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
Quote:
isprime(x,{flag=0}): true(1) if x is a (proven) prime number, false(0) if not. If flag is 0 or omitted, use a combination of algorithms. If flag is 1, the primality is certified by the Pocklington-Lehmer Test. If flag is 2, the primality is certified using the APRCL test. |
|
|
|
|
|
|
#242 |
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
Update: Prime found! 10462 * 12968192 + 1 is a probable prime! (Proth-GFN.) (Validating w/SPRP for random base. Might take 5-10 mins. Used base 2 to speed it up.)
![]() This is simply excellent. A PRP25503. Also: Passed base 2 SPRP test as well. (How seriously should one take PFGW's PRP result?) Hmm: Something interesting about hyperfactorials: k * hyperfactorial(a)^n + 1 cannot be prime when a is odd and when n is divisible by 2. Let's try even a; n is odd. Conjecture debunked: 1286 * hyperfactorial(8)^3 + 1 is prime. Next conjecture: It applies to all odd integers only? Debunked: 348 * hyperfactorial(9)^4 + 1 is prime; 261 * hyperfactorial(9)^6 + 1 is prime. Next: Applies to odd primes: Debunked: 811 * hyperfactorial(13)^4 + 1 is prime. Surprisingly, I found that all cases were composites when I tested a = 11. Pseudo-sierpinski number, anyone? Last fiddled with by 3.14159 on 2010-07-24 at 00:17 |
|
|
|
![]() |
| Thread Tools | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Wheel Factorization | a1call | Factoring | 11 | 2017-06-19 14:04 |
| Efficient Test | paulunderwood | Computer Science & Computational Number Theory | 5 | 2017-06-09 14:02 |
| LL tests more credit-efficient than P-1? | ixfd64 | Software | 3 | 2011-02-20 16:24 |
| A Wheel | storm5510 | Puzzles | 7 | 2010-06-25 10:29 |
| Most efficient way to LL | hj47 | Software | 11 | 2009-01-29 00:45 |