Module: primes/sieve-of-eratosthenes

Sieve of Eratosthenes. Simple, ancient algorithm for finding all prime numbers up to given limit. Returns list of primes up to specified limit. For example, for limit 10 it should return following list of primes: [2, 3, 5, 7].
Parameters:
Name Type Description
limit Number Algorithm will returns list of primes up to specified limit.
Source:
Returns:
Will return list with all prime numbers up to provided. limit.
Type
Array
Example
var sieveOfEratosthenes =
require('path-to-algorithms/src/sieve-of-eratosthenes').sieveOfEratosthenes;

console.log(sieveOfEratosthenes(12)); // [2, 3, 5, 7, 11]