Uses a hybrid table lookup and sieving algorithm.  Also provides the
option of using PARI's sieving algorithm, Andrew Ohana's optimized
Legendre algorithm, or Victor Miller's Lagarias Miller Odlyzko (LMO)
combinatorial algorithm.

Be sure to use the -m32 option when compiling the c code, and if
necessary, download the required libraries to run 32 bit code on your
computer.  Macbook pros should be the easiest to work.

The table of values of the prime counting function comes from
http://www.primefan.ru/stuff/primes/table.html  The gap between values
in the table is the same for each decade, and then jumps to a larger
value.  The performance of my prime_pi(x) is best near values of x in
the table, and worst for values halfway between.  The performance
decreases  after each power of 10, where the gap between table entries
increases.

I would like my code to be run against Mathematica on the same
machine.  It would be appropriate to create a random set of values in
each decade (i.e. values all with some number of digits) for
prime_pi.  For nth_prime, this would work, but for a better picture of
the performance of my code, it would be appropriate to make a random
set of values of n (to give to the nth_prime function) such that
nth_prime is between two successive powers of 10 (i.e. nth_prime is
some number of digits long) for each number of digits.

See 
http://en.wikipedia.org/wiki/Prime-counting_function#Table_of_.CF.80.28x.29.2C_x_.2F_ln_x.2C_and_li.28x.29
for a table of prime_pi.

Kevin Stueve
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to