mersenneforum.org  

Go Back   mersenneforum.org > Prime Search Projects > Riesel Prime Search

Reply
 
Thread Tools
Old 2010-10-14, 17:50   #12
mdettweiler
A Sunny Moo
 
mdettweiler's Avatar
 
Aug 2007
USA (GMT-5)

3×2,083 Posts
Default

Great, and exceedingly handy! A couple requests:

-Could the program be made to ignore ABC comments when a sieve depth is given on the command line? I have a lot of sieve files with headers like this:
ABC $a*28^$b-1 //7500000000000:M:1:28:258
modified as such to permit loading into PRPnet, while preserving the sieve depth data. As is, passing the sieve depth on the command line is not enough to get calcPrimes to work with this kind of file; it still chokes on the unrecognized format. Sure, I can get it to work by modifying the comment to "Sieved to x with srsieve", but it would be much easier if it would simply ignore anything after the // when I give it a sieve depth on the command line.

-One of the most personally useful figures from Gary's odds of prime spreadsheet is the "1 in x candidates" figure for a prime. Yours produces "1 in x" for the odds of prime in the entire file, which while still useful, is not quite the same thing. I'm assuming this would be an easy modification, but if it isn't, don't worry about it.

Thanks,
Max
mdettweiler is offline   Reply With Quote
Old 2010-10-14, 19:24   #13
Mini-Geek
Account Deleted
 
Mini-Geek's Avatar
 
"Tim Sorbera"
Aug 2006
San Antonio, TX USA

10000101011002 Posts
Default

Quote:
Originally Posted by mdettweiler View Post
Great, and exceedingly handy!
Glad to hear some other people find this cool and useful.
Quote:
Originally Posted by mdettweiler View Post
-Could the program be made to ignore ABC comments when a sieve depth is given on the command line? I have a lot of sieve files with headers like this:
ABC $a*28^$b-1 //7500000000000:M:1:28:258
modified as such to permit loading into PRPnet, while preserving the sieve depth data. As is, passing the sieve depth on the command line is not enough to get calcPrimes to work with this kind of file; it still chokes on the unrecognized format. Sure, I can get it to work by modifying the comment to "Sieved to x with srsieve", but it would be much easier if it would simply ignore anything after the // when I give it a sieve depth on the command line.
Hm, that's an unusual header. I never tested with that or figured anyone would have that (come to think of it, I may have seen it before, it just didn't come to mind). I moved some things to make the code sturdier (i.e. choke on fewer instances) for unusual things like that, made it skip the attempted parsing of the sieve depths when you specify it (previously, it always parsed, and then overwrote it with the supplied info), and then figured I could put in support for your format there. It can now read the sieve depth from a header like that (more specifically, anything like "ABC $a*28^$b-1 //7500000000000", and then there can be a colon and more info after the sieve depth)

It should now work and find the sieve depths on all of the following:
ABC $a*28^$b-1 //7500000000000
ABC $a*28^$b-1 //7500000000000:M:1:28:258
ABC $a*28^$b-1 // some words 7500000000000
ABC $a*28^$b-1 // sieved to 7500000000000 with srsieve
7500000000000:M:1:28:258
7500000000000:M:1:28:258 // ABC $a*28^$b-1
ABC $a*28^$b-1 // sieved to 7500000000000 with srsieve // {number_primes,$a,1}

and probably fail (error if you don't specify the sieve depth manually) on these:
ABC $a*28^$b-1 // 7500000000000
ABC $a*28^$b-1 // hi, this was sieved to 7500000000000
ABC $a*28^$b-1 // {number_primes,$a,1} // sieved to 7500000000000 with srsieve
Quote:
Originally Posted by mdettweiler View Post
-One of the most personally useful figures from Gary's odds of prime spreadsheet is the "1 in x candidates" figure for a prime. Yours produces "1 in x" for the odds of prime in the entire file, which while still useful, is not quite the same thing. I'm assuming this would be an easy modification, but if it isn't, don't worry about it.
Added. It was pretty easy: just had to see how many candidates there were and divide accordingly at the end. Note that this is an average over the whole range, so the only point it's right on for is the average case (effectively the same as the spreadsheet taking the one number at what you guess is the average point).
Edit: guess it might help to actually attach the program.
Edit 2: I've just made a small update to it so ABC $a*28^$b-1 //7500000000000 will work, and uploaded a new version.
Edit 3: Oops, I left some debug code in. (hardwired file name and no help: not the best code for a release version ) New version again.
Attached Files
File Type: zip calcPrimes.zip (5.6 KB, 134 views)

Last fiddled with by Mini-Geek on 2010-10-14 at 19:41
Mini-Geek is offline   Reply With Quote
Old 2010-10-14, 19:48   #14
mdettweiler
A Sunny Moo
 
mdettweiler's Avatar
 
Aug 2007
USA (GMT-5)

3×2,083 Posts
Default

Thanks--it works great!
mdettweiler is offline   Reply With Quote
Old 2010-10-14, 19:53   #15
Mini-Geek
Account Deleted
 
Mini-Geek's Avatar
 
"Tim Sorbera"
Aug 2006
San Antonio, TX USA

22×11×97 Posts
Default

I updated the help text a bit. Since there were so many revisions posted on the last post, and I think I'm done editing it until something else comes up, I'm putting it in a new post here.
Attached Files
File Type: zip calcPrimes.zip (5.6 KB, 144 views)
Mini-Geek is offline   Reply With Quote
Old 2010-10-14, 22:00   #16
Mini-Geek
Account Deleted
 
Mini-Geek's Avatar
 
"Tim Sorbera"
Aug 2006
San Antonio, TX USA

22×11×97 Posts
Default

To make it easier to use, I made it work either off of entering the info on the command line (like before), or being prompted to enter it after you run the program. I also made a batch file that runs "java -jar calcPrimes.jar" and passes arguments along to it (so it's not such a long line you have to type, and you can double click on the batch file instead of needing to open a command line). A similar bash script could be made just as easily (a very simple addition that makes it a lot easier to use - at least, my JVM doesn't run .jar's like that when I double click them). I also made lots of small updates to the messages it outputs, especially errors (so that it's a bit more helpful). Oh, and now "ABC $a*588^$b$c // 1500000000000" should work too.
Attached Files
File Type: zip calcPrimes.zip (6.9 KB, 186 views)

Last fiddled with by Mini-Geek on 2010-10-14 at 22:04
Mini-Geek is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Status page with expected number of Mersenne primes in each interval? CRGreathouse PrimeNet 2 2018-01-10 06:13
The expected number of primes Batalov Computer Science & Computational Number Theory 5 2016-08-11 01:17
Expected number of primes in OEIS A007908 ewmayer Probability & Probabilistic Number Theory 6 2015-11-10 16:33
I get 13% less primes than I expected:-( mart_r Math 2 2010-10-29 17:31
Twin primes expected first k formula robert44444uk Math 18 2008-04-02 21:19

All times are UTC. The time now is 07:25.


Sun Oct 17 07:25:29 UTC 2021 up 86 days, 1:54, 0 users, load averages: 0.86, 1.18, 1.28

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.