4.0.1 • Published 5 months ago

lucas-lehmer-test v4.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
5 months ago

lucas-lehmer-test

Lucas-Lehmer primality test in JavaScript. This is the primality test that is used by the Great Internet Mersenne Prime Search to locate large primes, and has done a pretty good job of finding some of the largest primes to date.

Example

Is the 31st Mersenne number a prime number?

var lucasLehmerTest = require('lucas-lehmer-test');

lucasLehmerTest(31);
// => true

Installation

$ npm install lucas-lehmer-test

API

var lucasLehmerTest = require('lucas-lehmer-test');

lucasLehmerTest(value)

Uses the Lucas-Lehmer primality test to determine if the valueth Mersenne number is a prime number. Returns true if it is; otherwise returns false. value can be a Number (it most cases it probably will be), a String (for really large numbers that JavaScript has a hard time with), or an instance of big-integer.

4.0.1

5 months ago

4.0.0

8 months ago

3.0.0

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago