primesieve
« Back to VersTracker
Description:
Fast C/C++ prime number generator
Type: Formula  |  Tracked Since: Dec 16, 2025
Links: Homepage  |  formulae.brew.sh
Category: Developer tools
Tags: primes mathematics sieve algorithm generator cli
Install: brew install primesieve
About:
primesieve is a highly optimized command-line tool and library for generating prime numbers using a segmented sieve of Eratosthenes algorithm. It efficiently handles very large primes and massive ranges by leveraging multi-threading and CPU cache optimizations. The tool can generate primes up to 10^10 quickly and provides detailed statistics about the sieving process.
Key Features:
  • Multi-threaded segmented sieve algorithm
  • Supports generating primes up to very large limits (e.g., 10^10)
  • Memory-efficient design using CPU cache optimization
  • Provides both command-line interface and C++ library API
  • Detailed sieving statistics and progress reporting
Use Cases:
  • Mathematical research requiring large sets of prime numbers
  • Performance benchmarking of sieve algorithms
  • Generating prime tables for educational or reference purposes
  • Integration into C++ applications needing prime number generation
Alternatives:
  • pfgw – Focuses on primality testing rather than efficient prime generation for large ranges
  • primecount – Specializes in counting primes rather than generating the actual prime numbers
Version History
Detected Version Rev Change Commit
Dec 16, 2025 2:24pm 0 VERSION_BUMP d0a9f638
Sep 11, 2025 11:00am 0 VERSION_BUMP c90fb2fe
Nov 18, 2024 7:53pm 0 VERSION_BUMP ecd192d2