#ChallengeMersenneNumber #DataStructure #List #ProgramFlow #Python
- A Mersenne number is any number that can be written as
- Write a function that accepts an exponent
Note: Mersenne numbers can only be prime if their exponent,
Hint: It may be useful to define the
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
- 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