0.0.4 • Published 8 years ago

eratosthing v0.0.4

Weekly downloads
4
License
ISC
Repository
github
Last release
8 years ago

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
0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

9 years ago

0.0.1

9 years ago