cached-primes

1.0.7 • Public • Published

This package provides O(1) lookup for the first 1 million prime numbers.

Install

npm install cached-primes

Usage

var cp = require('cached-primes');
 
// check if a number is a prime number
cp.isPrime(97127);     // true
 
// get the kth prime number
cp.getPrime(1);        // 2
cp.getPrime(1000000);  // 15485863

Dependents (0)

Package Sidebar

Install

npm i cached-primes

Weekly Downloads

4

Version

1.0.7

License

ISC

Unpacked Size

18.9 MB

Total Files

8

Last publish

Collaborators

  • jacksongl