A Mersenne prime is a prime number that is one less than a power of two. It is a prime number of the form
The script prints Mersenne prime numbers on the command line.
This script is ready to use script which uses one arguments to run. The argument is the integer passed for the number of primes to be printed.
Function prints numbers divided by a space character.
Invoking the script runs this function.
Function prints every number in a new line formatted to display in the
This script require the math, doctest and sys package.
$ git clone https://github.com/StokicDusan/MersennePrime
$ cd MersennePrime/
In the command line simply invoke the script with one argument:
$ python mersennePrimes.py argv1
- argv1:
Any positive integer
Invoking the script with no arguments will run testmod().
The following code block shows examples of calling the mersennePrimes script from terminal.
$ python3 mersennePrimes.py -20
$ python3 mersennePrimes.py 0
$ python3 mersennePrimes.py 1
3
$ python3 mersennePrimes.py 9
3 7 31 127 8191 131071 524287 2147483647 2305843009213693951
If you encounter any bugs or have suggestions, please file an issue in the Issues section of the project.