Number Theory: Mersenne Primes
Getting Started
While any command in the package can be referred to using the long form, for example, NumberTheory:-IsMersenne, it is often easier to load the package and then use the short form command names.
restart;
with(NumberTheory):
Examples
Mersenne Primes are prime numbers that are one less than a power of 2. These are of the form: Mn=2n−1, where n is a positive integer. The IthMersenne command returns the exponent for the Ith Mersenne prime number:
IthMersenne⁡4
7
27−1
127
The top level isprime command determines if a given number is prime:
isprime⁡27−1
true
The IsMersenne command checks if a positive integer, n, is a Mersenne exponent, where 2^n-1 is a Mersenne prime:
22−1
3
IsMersenne⁡2
211−1
2047
IsMersenne⁡11
false
ifactor⁡211−1
23⁢89
There are 49 known Mersenne Primes.
interface⁡rtablesize=52:
DataSeries⁡seq⁡IthMersenne⁡i,i=1..49,labels=seq⁡1..49
Warning, the rankings of the 45th to 51st Mersenne primes are provisional, since it has not been determined that there do not exist more Mersenne primes between 44th and 51st
See Also
NumberTheory
Download Help Document