primecount
Sublinear (in time and space) counting and summing of integer primes using optimized sieving method

Usage examples:

Count primes upto an upper boundary:

(primecount:prime-count (expt 10 11)) ;; => 4118054813
Sum primes upto an upper boundary:
(primecount:prime-sum (expt 10 11)) ;; => 201467077743744681014
Count primes of the forms 4m+1 and 4m+3 upto an upper boundary:
(primecount:prime-count-mod4 (expt 10 11)) ;; => 2059020280, 2059034532

Repository: GitHub

License: MIT

See Also: ulimyhmpqs

Topics: mathematics