mersenneforum.org  

Go Back   mersenneforum.org > Prime Search Projects > And now for something completely different

Reply
 
Thread Tools
Old 2018-04-11, 23:04   #23
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

11×577 Posts
Default

Quote:
Originally Posted by Citrix View Post
No optimizations - just testing one candidate at a time and then LLRing it if no factor was found.
The generic FFT made me stop the search as each candidate was taking too long.
Interesting. You basically ran sr1sieve against each individual candidate, then when sieved deeply enough, tested that candidate with llr. I'll consider that with my next revision.

*edit* After some experimentation, I don't think the method I just mentioned is faster. For 2*b^b+/-1 from n=200000 to n=210000 I can sieve with kbbsieve to 1e7 in 83 seconds. There are 1466 terms remaining. Per term sieving to 1e9 with srsieve/sr1sieve takes about 20 seconds. Even if half of those terms are removed between 1e7 and 1e9, that gives at most 8300 seconds for kbbsieve to sieve that range to 1e9. It would take srsieve/sr1sieve at least 15,000 seconds.

Last fiddled with by rogue on 2018-04-11 at 23:34
rogue is online now   Reply With Quote
Old 2018-04-11, 23:37   #24
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

11×577 Posts
Default

Quote:
Originally Posted by Dr Sardonicus View Post
The behavior of nn (mod p) has some (perhaps) interesting consequences for sieving.

If p == 3 (mod 8), then the multiplicative order m of Mod(-2, p) is odd, and the multiplicative order of Mod(2, p) is 2*m. It follows that the number of residues of n (mod (p-1)*p) for which

2*nn + 1 == 0 (mod p)

is three times the number for which

2*nn - 1 (mod p).

For example, with p = 3,

2*nn + 1 == 0 (mod 3) for n == 1, 2, or 4 (mod 6), while

2*nn - 1 == 0 (mod 3) for n == 5 (mod 6).

If p == 7 (mod 8) the situation is reversed; the multiplicative order m of Mod(2, p) is odd, and the multiplicative order of Mod(-2, p) is 2*m. The number of residues n (mod (p-1)*p) for which

2*nn - 1 -- 0 (mod p)

is three times the number for which

2*nn + 1 == 0 (mod p).

For example, with p = 7,

2*nn - 1 == 0 (mod 7) for n == 2, 4, 10, 23, 25, or 26 (mod 42), while

2*nn + 1 == 0 (mod 7) for n == 5 or 31 (mod 42).

For p == 5 (mod 8), the multiplicative orders of 2 and -2 (mod p) are the same, and the number of residues (mod (p-1)*p) for which 2*nn + 1 and 2*nn - 1 are divisible by p, are the same. For example, with p = 5,

2*nn - 1 == 0 (mod 5) for n == 7 or 13 (mod 20), while

2*nn + 1 == 0 (mod 5) for n == 3 or 17 (mod 20).

For p == 1 (mod 8) the situation is not generally predictable. If however 2 is not a biquadratic residue (mod p), then the numbers of residues (mod (p-1)*p) for which 2*nn + 1 and 2*nn - 1 are divisible by p, will be the same. Unfortunately, determining whether 2 is a biquadratic residue (mod p) isn't cheap AFAIK.

If m is the multiplicative order of 2 (-2, resp) mod p, the number of residues (mod (p-1)*p) for which 2*nn - 1 (2*nn+ 1, resp) are divisible by p are

(p-1)\sum_{d \mid \frac{p-1}{m}}\frac{\varphi(md)}{md}
Take a look at the code and see if you can implement some of these optimizations. Note that k does not need to equal 2 when running kbbsieve.

I also realized today that I can remove some terms due to algebraic factorizations, but haven't coded that yet.

Last fiddled with by rogue on 2018-04-11 at 23:37
rogue is online now   Reply With Quote
Old 2018-04-12, 00:14   #25
Citrix
 
Citrix's Avatar
 
Jun 2003

62E16 Posts
Default

Quote:
Originally Posted by rogue View Post
Interesting. You basically ran sr1sieve against each individual candidate, then when sieved deeply enough, tested that candidate with llr. I'll consider that with my next revision.

*edit* After some experimentation, I don't think the method I just mentioned is faster. For 2*b^b+/-1 from n=200000 to n=210000 I can sieve with kbbsieve to 1e7 in 83 seconds. There are 1466 terms remaining. Per term sieving to 1e9 with srsieve/sr1sieve takes about 20 seconds. Even if half of those terms are removed between 1e7 and 1e9, that gives at most 8300 seconds for kbbsieve to sieve that range to 1e9. It would take srsieve/sr1sieve at least 15,000 seconds.
It was faster than PFGW/Multisieve. I did not have kbbsieve several years ago, when I tested it.
Citrix is offline   Reply With Quote
Old 2018-04-12, 02:33   #26
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

11·577 Posts
Default

Quote:
Originally Posted by Citrix View Post
It was faster than PFGW/Multisieve. I did not have kbbsieve several years ago, when I tested it.
That makes sense. llr should be able to run with the output from kbbsieve.
rogue is online now   Reply With Quote
Old 2018-04-12, 11:24   #27
henryzz
Just call me Henry
 
henryzz's Avatar
 
"David"
Sep 2007
Cambridge (GMT/BST)

23·3·5·72 Posts
Default

I think that I now understand how to add a form based upon your guide. I am going to try to create a {b_1}^{n_1} * b_2^{n_2}\pm c sieve with varying n_1 and n_2 based upon the xyyx sieve.
Once that is done I may extend it to more than two bases possibly with fixed n. I would imagine that the majority of the work will be in combining the different combinations of {b_1}^{n_1} and {b_2}^{n_2} modulo p given enough of them. The speed will probably be proportional to the number of terms remaining.
henryzz is online now   Reply With Quote
Old 2018-04-12, 14:20   #28
Dr Sardonicus
 
Dr Sardonicus's Avatar
 
Feb 2017
Nowhere

4,643 Posts
Default

Quote:
Originally Posted by rogue View Post
Take a look at the code and see if you can implement some of these optimizations. Note that k does not need to equal 2 when running kbbsieve.

I also realized today that I can remove some terms due to algebraic factorizations, but haven't coded that yet.
I'm afraid me looking at the code would not result in much more than my eyes crossing and glazing over. The formula I concocted will work for k, if m is the multiplicative order of Mod(k, p) [resp Mod(-k,p)], provided of course that the prime p does not divide k. The only (possibly) useful thing the formula tells me is, the primes p giving a (relatively) bountiful harvest of residues mod (p-1)*p, are those for which the multiplicative order of Mod(k,p) is very small. For k = 2, then, Mersenne primes would in a sense do the "best" at sieving out candidates.

Algebraic factors are a great idea. I had had it on my list of things to look at, but hadn't yet come up with any examples...
Dr Sardonicus is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Primes of the form (b+-1)*b^n+-1 and b^n+-(b+-1) sweety439 sweety439 162 2020-05-15 18:33
Primes of the form n+-phi(n) carpetpool carpetpool 3 2017-01-26 01:29
Infinitely many primes of a form? PawnProver44 Homework Help 1 2016-03-15 22:39
Primes of the form a^(2^n)+b^(2^n) YuL Math 21 2012-10-23 11:06
Primes of the form 2.3^n+1 Dougy Math 8 2009-09-03 02:44

All times are UTC. The time now is 17:21.


Fri Jul 16 17:21:09 UTC 2021 up 49 days, 15:08, 1 user, load averages: 1.28, 1.63, 1.64

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.