Skip to content

cristiangpr/is-known-mersenne

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Is Known Mersenne

Quickly determines if a number is a known mersenne prime. Returns boolean value

openbits logo This package is also served through OpenBits (http://openbits.world)

Prerequisites

Node 10.4 or later

Installation

npm install is-known-mersenne

Usage

Input must be in BigInt format. Simply add n after all integers.

const isKnownMersenne = require('is-known-mersenne');

isKnownMersenne(7n); => true
isKnownMersenne(2n**2n-1n) => true
isKnownMersenne(10n); => false
isKnownMersenne(2n**10n-1n); => false


Running the tests

npm test

Author

  • Cristian Perez Ramirez

License

This project is licensed under the MIT License - see the LICENSE file for details

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published