Epython Lab
6.76K subscribers
633 photos
30 videos
103 files
1.16K links
Welcome to Epython Lab, where you can get resources to learn, one-on-one trainings on machine learning, business analytics, and Python, and solutions for business problems.

Buy ads: https://telega.io/c/epythonlab
Download Telegram
#ChallengeMersenneNumber #DataStructure #List #ProgramFlow #Python

- A Mersenne number is any number that can be written as 2^p - 1 for some p. For example, 3 is a Mersenne number (2^2 - 1) as is 31 (2^5 - 1).

- Write a function that accepts an exponent p and returns the corresponding Mersenne number.

Note: Mersenne numbers can only be prime if their exponent, p, is prime. Make a list of the Mersenne numbers for all primes p between 3 and 65 (there should be 17 of them).

Hint: It may be useful to define the is_prime and get_primes functions for use in this problem.

N.B: define a function that accepts an exponent and returns the corresponding Mersenne number. Test the execution time of your algorithm before submitting to this challenge.

Prize: Top 3 winners will gain access to this channel
Direction
:- Post your solution @pythonethbot
👍1