eratosthing

0.0.4 • Public • Published

Build Status

This implements in JavaScript an online algorithm for finding successive primes in O(n log n) using a priority queue of composites, as proposed by Melissa O'Neill in her 2008 The Genuine Sieve of Eratosthenes.

Finding her paper allowed me to reduce runtime by 60% by starting each filter at at n^2, rather than n*2, and by using her unrolled wheel of candidates.

Installation

npm install eratosthing

Usage

const eratosthing = require("eratosthing");
let generator = eratosthing();
let value = generator.next().value;

Testing

npm test

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.4
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.4
    1
  • 0.0.3
    1
  • 0.0.2
    2
  • 0.0.1
    3

Package Sidebar

Install

npm i eratosthing

Weekly Downloads

7

Version

0.0.4

License

ISC

Last publish

Collaborators

  • bluej100