Ramanujan primes/twins: Difference between revisions

Content added Content deleted
Line 16: Line 16:
While finding the 1,000,000th Ramanujan prime is reasonably cheap (~70s), repeating that
While finding the 1,000,000th Ramanujan prime is reasonably cheap (~70s), repeating that
trick to find all 1,000,000 of them individually is over 2 years worth of CPU time.
trick to find all 1,000,000 of them individually is over 2 years worth of CPU time.
Calculating pi(p) - pi(floor(pi/2) for all primes below that one millionth, and then
Calculating pi(p) - pi(floor(pi/2) for all (normal) primes below that one millionth, and then
filtering (normal primes) based on that list is significantly faster. Finally we can
filtering them based on that list is significantly faster, and finally we can scan for twins.
than filter/scan that list for twins.
<!--<lang Phix>(phixonline)-->
<!--<lang Phix>(phixonline)-->
<span style="color: #008080;">with</span> <span style="color: #008080;">javascript_semantics</span>
<span style="color: #008080;">with</span> <span style="color: #008080;">javascript_semantics</span>