miguelmota / sieve-of-eratosthenes

Sieve of Eratosthenes JavaScript implementation

Home Page:https://github.com/miguelmota/sieve-of-eratosthenes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sieve-of-eratosthenes

Sieve of Eratosthenes algorithm implementation in JavaScript.

Sieve of Eratosthemes algorithm

source

NPM

Install

npm install sieve-of-eratosthenes
bower install sieve-of-eratosthenes

Usage

var sieveOfErathosthenes = require('sieve-of-eratosthenes');

var primes = sieveOfErathosthenes(100);

console.log(primes);
//
[ 2,
  3,
  5,
  7,
  11,
  13,
  17,
  19,
  23,
  29,
  31,
  37,
  41,
  43,
  47,
  53,
  59,
  61,
  67,
  71,
  73,
  79,
  83,
  89,
  97 ]

License

MIT

About

Sieve of Eratosthenes JavaScript implementation

https://github.com/miguelmota/sieve-of-eratosthenes

License:MIT License


Languages

Language:JavaScript 100.0%