npm

Share private packages across your team with npm Orgs, now with simplified billing via the aws marketplace!Learn more »

thaw-sieve-of-eratosthenes

0.0.1 • Public • Published

thaw-sieve-of-eratosthenes

A JavaScript implementation of the Sieve of Eratosthenes, an ancient Greek prime number generator.

Build Status npm npm license Maintainability Known Vulnerabilities

Most of this project's infrastructure was stolen from Jason Mulligan's (avoidwork's) tiny-graph project.

Installation

To install the stable version:

npm install --save thaw-sieve-of-eratosthenes

Example

const engine = require('thaw-sieve-of-eratosthenes');
 
console.log(engine.sieve(20)); // [2, 3, 5, 7, 11, 13, 17, 19]
 
console.log(engine.factorize(72)); // [2, 2, 2, 3, 3]

API

factorize(n)

Returns the unique prime factorization of n as a list of integers

sieve(n)

Returns the list of all prime numbers less than n

License

MIT

install

npm i thaw-sieve-of-eratosthenes

Downloadsweekly downloads

0

version

0.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability