mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Miscellaneous Math

Reply
 
Thread Tools
Old 2010-08-01, 22:13   #199
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

69016 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
Ah. I assumed you meant something nonobvious: that every odd prime was a member of a finite arithmetic progression of primes (with 3+ terms). Clearly every integer is in the arithmetic progression with common difference 1...
Hmm.. That problem seems interesting.
3.14159 is offline   Reply With Quote
Old 2010-08-02, 13:18   #200
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Cool

Quote:
Originally Posted by 3.14159 View Post
Hmm.. That problem seems interesting.
I posted it here:
http://mathoverflow.net/questions/34...mes-in-a-pap-3
CRGreathouse is offline   Reply With Quote
Old 2010-08-02, 14:39   #201
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

69016 Posts
Default

My setup on Python for listing numbers that have no factors below a given prime number, in a given range: Note that n > largest prime listed

Code:
for n in range(1, 700):
	if n%2 !=0 and n%3 != 0 and n%5 != 0 and n%7 != 0 and n%11!= 0 and n%13 != 0 and n%17 != 0 and n%19 != 0 and n%23 != 0:
		print n
The obvious problem: Expression becomes too long even before I have used only the first 10 primes. I attempted if n%(2, 3, 5, 7, 11, 13, 17, ..) != 0, print n, but got a syntax error.

Last fiddled with by 3.14159 on 2010-08-02 at 14:54
3.14159 is offline   Reply With Quote
Old 2010-08-02, 15:11   #202
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

So either use a wheel sieve (dividing by, say, 30n + {1,7,11,13,17,19,23,29} in addition to the primes dividing the wheel, in this case 2,3,5) or make an array of small primes and loop through it.
CRGreathouse is offline   Reply With Quote
Old 2010-08-02, 15:18   #203
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

32208 Posts
Default

Quote:
Originally Posted by CRGreathouse
So either use a wheel sieve (dividing by, say, 30n + {1,7,11,13,17,19,23,29} in addition to the primes dividing the wheel, in this case 2,3,5) or make an array of small primes and loop through it.
A wheel sieve: Pseudocode?

Also: A recommended list of programs for small primes? (I currently prove small primes via trial division or Miller-Rabin, in two separate applets. (About 30-60 iterations). Sadly, the latter applet cannot handle Proth numbers.)

Last fiddled with by 3.14159 on 2010-08-02 at 16:02
3.14159 is offline   Reply With Quote
Old 2010-08-02, 16:33   #204
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

7·503 Posts
Default

Quote:
Originally Posted by 3.14159 View Post

Also: A recommended list of programs for small primes? (I currently prove small primes via trial division or Miller-Rabin, in two separate applets. (About 30-60 iterations). Sadly, the latter applet cannot handle Proth numbers.)
More info... How small is small? Do you want to generate a list of them? Prove an existing list of them? Only of special form?

YAFU can give you a list of primes in any range you want up to 4*10^18... of course I'd keep the range smallish (1 billion or less) unless you have equal (and very great) amounts of patience and hard disk space.

Code:
% time yafu "primes(0,1000000000,0)" -pfile

ans = 50847534

10.188u 1.249s 0:16.31 70.0%    0+0k 0+0io 0pf+0w

% tail primes.dat
999999733
999999739
999999751
999999757
999999761
999999797
999999883
999999893
999999929
999999937
bsquared is offline   Reply With Quote
Old 2010-08-02, 16:42   #205
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24×3×5×7 Posts
Default

Quote:
Originally Posted by bsquared
More info... How small is small? Do you want to generate a list of them? Prove an existing list of them? Only of special form?
By small, I mean about 10-30 digits.

Last fiddled with by 3.14159 on 2010-08-02 at 16:48
3.14159 is offline   Reply With Quote
Old 2010-08-02, 18:52   #206
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
By small, I mean about 10-30 digits.
Proving the primality of a 30-digit number by trial division would take ~ pi(10^30) = 29844570422669 stored primes, which would take 217 TB @ 64 bits each.
CRGreathouse is offline   Reply With Quote
Old 2010-08-02, 19:07   #207
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

110100100002 Posts
Default

Quote:
Originally Posted by CRGreathouse
Proving the primality of a 30-digit number by trial division would take ~ pi(10^30) = 29844570422669 stored primes, which would take 217 TB @ 64 bits each.
I use Miller-Rabin for those proofs. And, the app divides by any odd number that ends in 1, 3, 7, or 9, regardless of whether or not it is prime.
3.14159 is offline   Reply With Quote
Old 2010-08-02, 20:51   #208
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24·3·5·7 Posts
Default

So, far, I have sieved up to about 2.66 * 1012 + 1 in NewPGen, while searching for a 66893 to 66896-digit prime. The candidates left are about 1 in 14. I need to get rid of about 12900 more candidates to get 1 in 20.

Last fiddled with by 3.14159 on 2010-08-02 at 20:57
3.14159 is offline   Reply With Quote
Old 2010-08-02, 21:31   #209
axn
 
axn's Avatar
 
Jun 2003

508710 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
The candidates left are about 1 in 14. I need to get rid of about 12900 more candidates to get 1 in 20.
Sure. Just sieve till 1.17*10^17
axn is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Prime posting thread, part 2. (With a catch.) 3.14159 Miscellaneous Math 55 2010-11-19 23:55
Tiny range request .... 555.1M petrw1 LMH > 100M 1 2010-07-13 15:35
Other primes thread nuggetprime No Prime Left Behind 32 2009-10-21 21:48
Error: tiny factoring failed 10metreh Msieve 26 2009-03-08 23:28
Tiny error on nfsnet pages. antiroach NFSNET Discussion 1 2003-07-08 00:27

All times are UTC. The time now is 15:01.


Fri Aug 6 15:01:04 UTC 2021 up 14 days, 9:30, 1 user, load averages: 3.01, 2.83, 2.82

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.