Question: A prime number is called a Mersenne prime if it can be written in the form 2 p - 1 for some positive integer p.
A prime number is called a Mersenne prime if it can be written in the form 2p - 1 for some positive integer p. Write a program that finds all Mersenne primes with p ? 100 and displays the output as shown below.
2 1 2 3 3 31 5
Step by Step Solution
3.42 Rating (165 Votes )
There are 3 Steps involved in it
Program plan Initialise the value of p with 2 Compute the value of 2 p 1 Call function the compu... View full answer
Get step-by-step solutions from verified subject matter experts
