#7013: [with code, needs work] prime_pi and nth_prime
--------------------------------------+-------------------------------------
Reporter: kevin.stueve | Owner: kevin.stueve
Type: enhancement | Status: new
Priority: major | Milestone: sage-4.1.2
Component: number theory | Keywords: primes, sieve, table,LMO
Reviewer: was,robertwb,GeorgSWeber | Author: Kevin Stueve
Merged: |
--------------------------------------+-------------------------------------
Comment(by kevin.stueve):
Andrew Ohana's prime_pi is the one currently in Sage. Yes,
clean_prime_pi.py is the code to look at. The other files in the zip are
earlier versions of my code (including me experimenting with single/dual
core etc).
By line 145 did you mean
byte3=inputfile.read(1) in the get_table_pi function?
Note that the get_table_pi function in its current state is designed only
for when Li(x)-pi(x) (which is positive for all x<10**316 (see
http://en.wikipedia.org/wiki/Skewes%27_number and the included article
link (Patrick Demichel. The prime counting function and related subjects)
that I just fixed so it wasn't a dead link), so we don't need to worry
about storing negatives) fits in three bytes base 256, so if larger values
are desired, the table must be expanded to use four bytes in such cases.
Li(x)-pi(x) exceeds 256**3 somewhere between 10**17 and 10**18 (see
http://en.wikipedia.org/wiki/Prime-counting_function).
I look forward to seeing how the code is improved and made more
safe/clean/robust.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7013#comment:11>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---