20101014, 17:50  #12 
A Sunny Moo
Aug 2007
USA (GMT5)
3×2,083 Posts 
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^$b1 //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 
20101014, 19:24  #13  
Account Deleted
"Tim Sorbera"
Aug 2006
San Antonio, TX USA
1000010101100_{2} Posts 
Glad to hear some other people find this cool and useful.
Quote:
It should now work and find the sieve depths on all of the following: ABC $a*28^$b1 //7500000000000 ABC $a*28^$b1 //7500000000000:M:1:28:258 ABC $a*28^$b1 // some words 7500000000000 ABC $a*28^$b1 // sieved to 7500000000000 with srsieve 7500000000000:M:1:28:258 7500000000000:M:1:28:258 // ABC $a*28^$b1 ABC $a*28^$b1 // 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^$b1 // 7500000000000 ABC $a*28^$b1 // hi, this was sieved to 7500000000000 ABC $a*28^$b1 // {number_primes,$a,1} // sieved to 7500000000000 with srsieve Quote:
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^$b1 //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. Last fiddled with by MiniGeek on 20101014 at 19:41 

20101014, 19:48  #14 
A Sunny Moo
Aug 2007
USA (GMT5)
3×2,083 Posts 
Thanksit works great!

20101014, 19:53  #15 
Account Deleted
"Tim Sorbera"
Aug 2006
San Antonio, TX USA
2^{2}×11×97 Posts 
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.

20101014, 22:00  #16 
Account Deleted
"Tim Sorbera"
Aug 2006
San Antonio, TX USA
2^{2}×11×97 Posts 
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.
Last fiddled with by MiniGeek on 20101014 at 22:04 
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  20180110 06:13 
The expected number of primes  Batalov  Computer Science & Computational Number Theory  5  20160811 01:17 
Expected number of primes in OEIS A007908  ewmayer  Probability & Probabilistic Number Theory  6  20151110 16:33 
I get 13% less primes than I expected:(  mart_r  Math  2  20101029 17:31 
Twin primes expected first k formula  robert44444uk  Math  18  20080402 21:19 