Number Theory: Mersenne Primes - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Applications and Example Worksheets : Number Theory : examples/NumberTheory/MersennePrimes

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=2n1, where n is a positive integer. The IthMersenne command returns the exponent for the Ith Mersenne prime number:

IthMersenne4

7

(1)

271

127

(2)

The top level isprime command determines if a given number is prime:

isprime271

true

(3)

The IsMersenne command checks if a positive integer, n, is a Mersenne exponent, where 2^n-1 is a Mersenne prime:

221

3

(4)

IsMersenne2

true

(5)

2111

2047

(6)

IsMersenne11

false

(7)

ifactor2111

2389

(8)

There are 49 known Mersenne Primes.

interfacertablesize=52:

DataSeriesseqIthMersennei,i=1..49,labels=seq1..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

DataSeries235713171931618910712752160712792203228132174253442396899941112131993721701232094449786243110503132049216091756839859433125778713982692976221302137769725931346691720996011240365832596495130402457325826573715666742643801431126095788516174207281,labels=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,datatype=anything

(9)

See Also

NumberTheory