mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Math

Reply
 
Thread Tools
Old 2015-10-23, 11:43   #12
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

3,739 Posts
Default

http://primes.utm.edu/top20/sizes.php shows the digit sizes you need for UTM's prime database.
paulunderwood is offline   Reply With Quote
Old 2015-10-23, 13:13   #13
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

22×5×373 Posts
Default

Quote:
Originally Posted by paulunderwood View Post
http://primes.utm.edu/top20/sizes.php shows the digit sizes you need for UTM's prime database.
And?

This is irrelevant and off-topic for the current thread.
R.D. Silverman is offline   Reply With Quote
Old 2015-10-23, 13:42   #14
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

373910 Posts
Default

I thought I read "n*2^100000+1" and not "n*2^10000+1" in fivemack's post.
paulunderwood is offline   Reply With Quote
Old 2015-10-23, 15:41   #15
fivemack
(loop (#_fork))
 
fivemack's Avatar
 
Feb 2006
Cambridge, England

641910 Posts
Default

paulunderwood is of course right about my underlying intentions; at the moment I'm warming up, and trying to work out whether I've got enough computrons in my herd to make a realistic attempt at getting at least into the AP4 list, if not the AP4 record.

(I'd be doing it the dumb way, enumerating the primes and then searching for the APs, and of course I realise it's an exercise in persistence and paying electricity bills rather than anything very closely resembling maths)

Last fiddled with by fivemack on 2015-10-23 at 15:41
fivemack is offline   Reply With Quote
Old 2015-10-23, 16:42   #16
chris2be8
 
chris2be8's Avatar
 
Sep 2009

2·1,039 Posts
Default

Will the numbers be a mixture of odd and even numbers? If so you can save half the work as follows:

Call the numbers you want A B and C where A-B=B-C (that makes A largest). Search all A, C to see if the average (A+C)/2 is in the set. This can only happen if A and C are both odd or both even so start by splitting the list into two parts, one with the odd numbers and one with the even numbers. Then pick A and C from one list and see if B exists (B could be odd or even so search both lists or the original list). That should save a factor of 2 assuming as many odd as even.

If all the numbers are odd you can do something similar by splitting them into 4n+1 and 4n+3 lists.

If the numbers are all prime you can probably speed it up further by splitting into 12n+1,5,7,11 and only checking cases where A and C are not 3n+1 and 3n+2 since the average will be a multiple of 3. And extend further to skip multiples of 5, 7 etc.

To search for longer progressions you could search for progressions of 3, then check those relatively few cases to see if they extend any further at either end.

Chris
chris2be8 is offline   Reply With Quote
Old 2015-10-25, 14:47   #17
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

203008 Posts
Default

Code:
a=[1,2,3,4,7,8,100];b=parselect(r->#parselect(c->#setminus(Vec([r-c,r+c]),a)==0,[1..eval(vecmax(a)-r)])!=0,a)
this figures out all middle points in the vector [1,2,3,4,7,8,100].Edit: okay technically the real setminus condition should be >1 because there's a possibility of one side being there but the other not being there. and the outer value can be changed to ==1 if you want those with one distinct linear sequence etc.

Last fiddled with by science_man_88 on 2015-10-25 at 15:45
science_man_88 is offline   Reply With Quote
Old 2015-10-25, 15:49   #18
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

oh and of course you can use parvector for large vectors and setminus and vecmax have parallel code potentially using parapply or as:


and


respectively.

Last fiddled with by science_man_88 on 2015-10-25 at 16:32
science_man_88 is offline   Reply With Quote
Old 2015-10-25, 16:36   #19
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

250516 Posts
Default

Quote:
Originally Posted by fivemack View Post
paulunderwood is of course right about my underlying intentions; at the moment I'm warming up, and trying to work out whether I've got enough computrons in my herd to make a realistic attempt at getting at least into the AP4 list, if not the AP4 record.

(I'd be doing it the dumb way, enumerating the primes and then searching for the APs, and of course I realise it's an exercise in persistence and paying electricity bills rather than anything very closely resembling maths)
David Broadhurst was employing the clever strategy (every few years) for AP3: wait for others to generate thousands of (otherwise totally useless) primes and then use that as an input for a combinatorial search. When there's a few thousand primes, one finds a few million AP3 candidates by linear combinations (in three ways: p1-p2-x, p1-x-p2, x-p1-p2), and then luckily NewPGen is useful again to sieve the x's all together (works really fast, after getting over the initial arrays to sparse-array transition point).

AP4 and higher, indeed, need another strategy; it is only by very improbable luck an AP4 could be found in the above way.
Batalov is offline   Reply With Quote
Old 2015-10-26, 17:51   #20
fivemack
(loop (#_fork))
 
fivemack's Avatar
 
Feb 2006
Cambridge, England

72·131 Posts
Default

Serge is (of course) right.

It seems that the number of terms of a sequence of density D that you need to take in order to hit an arithmetic progression of length N+2 is around D^(-N/2); so you'd want a few tens of thousands of primes of the form n*2^32768+1 to get an AP4, and a few million to get an AP5.

I have found 1425 primes of that form by going over 1<n<2^24 in about 150 CPU-hours on a fast computer, so I could get to a few tens of thousands by Christmas, but an AP4 of primes that small wouldn't be interesting, and finding a few million primes and an AP5 is impractical.
fivemack is offline   Reply With Quote
Old 2015-10-28, 17:56   #21
chris2be8
 
chris2be8's Avatar
 
Sep 2009

81E16 Posts
Default

If you just want an AP3 (or AP4) with large terms you should be able to speed the search up by:

1: Choosing a primorial of the size you are interested in, x#
2: Search for primes of the form n*x#+1
3: For each pair of primes check if they are part of an AP3 (3 ways, x-p1-p2, p1-x-p2, p1-p2-x as Batalov said above). If they are see if it extends any further.

Since the third term will be of the same form it won't be divisible by any prime below x. Which should increase the chance it's prime. Whether it increases it enough to make the search feasible depends how big an AP3 you want and what resources you have.

Chris
chris2be8 is offline   Reply With Quote
Old 2015-10-28, 23:11   #22
fivemack
(loop (#_fork))
 
fivemack's Avatar
 
Feb 2006
Cambridge, England

191316 Posts
Default

Quote:
Originally Posted by chris2be8 View Post
If you just want an AP3 (or AP4) with large terms you should be able to speed the search up by:

1: Choosing a primorial of the size you are interested in, x#
2: Search for primes of the form n*x#+1
3: For each pair of primes check if they are part of an AP3 (3 ways, x-p1-p2, p1-x-p2, p1-p2-x as Batalov said above). If they are see if it extends any further.
Assuming that I start by searching some initial segment of the numbers of the form n*x#+1, I'll never get an x-p1-p2 or p1-x-p2 where I don't already know the status of x. If I start with the 23483 primes n*2^16384+1 with n<2^27, extrapolating p1-p2-x gets me 74230413 distinct larger candidates to look at, which isn't a very big reduction on 2^27.
fivemack is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you efficiently sieve for prime 3/4-tuples? Puzzle-Peter Software 156 2019-06-03 20:19
Exponent Progression storm5510 Information & Answers 15 2017-07-26 18:02
Bertrand's Theorem for Arithmetic Progression literka Math 0 2013-06-01 12:42
Milestone Progression Update NBtarheel_33 Data 2 2010-09-02 03:14
nth prime number in an arithmetic progression Unregistered Information & Answers 1 2010-04-04 22:06

All times are UTC. The time now is 18:46.


Fri Jul 16 18:47:00 UTC 2021 up 49 days, 16:34, 1 user, load averages: 3.44, 4.67, 4.62

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.