![]() |
![]() |
#1 |
May 2007
Kansas; USA
2×5×1,031 Posts |
![]()
To all,
This might be useful for some of you... I created the attached spreadsheet shortly after I found RPS and have been using it to determine the odds that a prime will be found within a sieved file. It also tells you about how many primes that you can expect for a sieved file and calculates the odds of finding a twin, triplet, or quadruplet. I used it to determine how large of a range to sieve for the twin and quads that I found. You just plug in the k, base, avg. n, sieve depth, and # of candidates and it does the rest. The base crux of the formulas came from Axn1 in a thread here at RPS. I just took it a little further to account for changes in k and base and to add the twin/triplet/quad odds calculations. (The k makes very little difference except at very low values of n.) Gary |
![]() |
![]() |
![]() |
#2 |
Sep 2004
2×5×283 Posts |
![]()
That's a very useful tool. Thanks!
|
![]() |
![]() |
![]() |
#3 |
"Jason Goatcher"
Mar 2005
DB116 Posts |
![]()
If I may ask a stupid question, what is the best way to run this? I've tried various things in Linux and none of them worked. Googling was an exercise in frustration, there's lot's of php stuff but I'm not totally sure what I'm looking for.
|
![]() |
![]() |
![]() |
#4 |
Jul 2007
Tennessee
25·19 Posts |
![]()
OpenOffice spreadsheet?
|
![]() |
![]() |
![]() |
#5 |
May 2007
Kansas; USA
1031010 Posts |
![]()
It's a Microsoft Excel spreadsheet. If you have Excel, just open the zip file and double-click the spreadsheet and it should open. If you don't have Excel, you would need to get it.
|
![]() |
![]() |
![]() |
#6 |
A Sunny Moo
Aug 2007
USA (GMT-5)
3×2,083 Posts |
![]() |
![]() |
![]() |
![]() |
#7 |
Account Deleted
"Tim Sorbera"
Aug 2006
San Antonio, TX USA
17·251 Posts |
![]()
The odds of prime spreadsheet is very useful, but when the n (or, to a lesser extent, the k) varies greatly, (as is common in CRUS work, or over large areas of any work) it is hard to choose the right average n to get accurate results.
I've made a simple command line Java app that has the same function as the odds of prime spreadsheet, but instead of making you pick the average k and n, it reads each k/n pair and works off of that. It reports relevant numbers for primes and twin primes (not triplet or quadruplet). It is attached as a .jar, along with the source (it's not commented, and it includes some other code unused here, but I figured better messy source than no source ![]() Note that it is pretty picky with the sieve depth and sieve file. The sieve depth parser is extremely simple: first replace "G" with 9 zeroes and "T" with 12 zeroes, then use Java's Long.parseLong (e.g. 1.5*10^12, 1.5T, and 15M are all invalid, while 1T, 1500G, and 15000000 are valid). And the sieve file must be in NewPGen format ("k n" on each line) with no header of any sort, just the k and n. This has had very little testing, but I've checked it against the spreadsheet on one file, and the results seems to be accurate. |
![]() |
![]() |
![]() |
#8 |
Just call me Henry
"David"
Sep 2007
Cambridge (GMT/BST)
2·41·71 Posts |
![]()
Nice program. Could you make it ignore header lines(or read the stuff from them)?
Last fiddled with by henryzz on 2010-10-13 at 17:48 |
![]() |
![]() |
![]() |
#9 | |
Account Deleted
"Tim Sorbera"
Aug 2006
San Antonio, TX USA
17×251 Posts |
![]() Quote:
![]() |
|
![]() |
![]() |
![]() |
#10 | |
Just call me Henry
"David"
Sep 2007
Cambridge (GMT/BST)
2·41·71 Posts |
![]() Quote:
|
|
![]() |
![]() |
![]() |
#11 |
Feb 2003
111011101002 Posts |
![]()
That's a really useful tool!
Thank you, Mini-Geek! ![]() |
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
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 |