sieve-of-sundaram

1.0.0 • Public • Published

Sieve of Sundaram

Sieve of Sundaram implemented in JavaScript

Algorithm

Any contributions to make this better are welcome :)

Install

npm install sieve-of-sundaram

Usage

Note : For all practical purposes, you should be using the Sieve of Eratosthenes which is available as a module here

var sieve-of-sundaram = require('sieve-of-sundaram')
var primes = sieve-of-sundaram(100)
console.log(primes)
//
[ 1,
  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 ]

Package Sidebar

Install

npm i sieve-of-sundaram

Weekly Downloads

0

Version

1.0.0

License

ISC

Last publish

Collaborators

  • harrisjose