![]() |
|
|
#12 |
|
Sep 2002
Database er0rr
3,739 Posts |
http://primes.utm.edu/top20/sizes.php shows the digit sizes you need for UTM's prime database.
|
|
|
|
|
|
#13 | |
|
Nov 2003
22×5×373 Posts |
Quote:
This is irrelevant and off-topic for the current thread. |
|
|
|
|
|
|
#14 |
|
Sep 2002
Database er0rr
373910 Posts |
I thought I read "n*2^100000+1" and not "n*2^10000+1" in fivemack's post.
|
|
|
|
|
|
#15 |
|
(loop (#_fork))
Feb 2006
Cambridge, England
641910 Posts |
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 |
|
|
|
|
|
#16 |
|
Sep 2009
2·1,039 Posts |
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 |
|
|
|
|
|
#17 |
|
"Forget I exist"
Jul 2009
Dumbassville
203008 Posts |
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) Last fiddled with by science_man_88 on 2015-10-25 at 15:45 |
|
|
|
|
|
#18 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
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 |
|
|
|
|
|
#19 | |
|
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2
250516 Posts |
Quote:
AP4 and higher, indeed, need another strategy; it is only by very improbable luck an AP4 could be found in the above way. |
|
|
|
|
|
|
#20 |
|
(loop (#_fork))
Feb 2006
Cambridge, England
72·131 Posts |
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. |
|
|
|
|
|
#21 |
|
Sep 2009
81E16 Posts |
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 |
|
|
|
|
|
#22 | |
|
(loop (#_fork))
Feb 2006
Cambridge, England
191316 Posts |
Quote:
|
|
|
|
|
![]() |
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 |