primesieve  6.0
primesieve Documentation

About

primesieve is a C/C++ library for fast prime number generation. It generates the primes below 10^9 in just 0.2 seconds on a single core of an Intel Core i7-6700 3.4GHz CPU. primesieve can generate primes and prime k-tuplets up to 2^64. primesieve's memory requirement is about pi(sqrt(n)) * 8 bytes per thread, its run-time complexity is O(n log log n) operations. The recommended way to get started is to first have a look at a few C or C++ example programs. The most common use cases are storing primes in a vector (or array) and iterating over primes using next_prime() or prev_prime().

For more information please visit http://primesieve.org.

C++ API

C API