Socket
Socket
Sign inDemoInstall

cached-primes

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cached-primes

first 1 million prime numbers


Version published
Weekly downloads
12
increased by33.33%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 08 Apr 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc