simple-prime-generator

1.1.0 • Public • Published

Generate prime numbers

3 strategies

  • Naive (O(n^2)) -> naive
  • Optimized (O(n^3/2)) -> opt
  • Eratosthenes' sieve (O(n*log(log(n)))) -> best

Run in the console

Examples:

gen-primes 1 10 naive
->[ 2, 3, 5, 7 ]
gen-primes 1 10 opt
->[ 2, 3, 5, 7 ]
gen-primes 1 10 best
->[ 2, 3, 5, 7 ]

Readme

Keywords

Package Sidebar

Install

npm i simple-prime-generator

Weekly Downloads

2

Version

1.1.0

License

ISC

Unpacked Size

4.01 kB

Total Files

10

Last publish

Collaborators

  • acuityx