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

2 1 2 3 3 31 5

Step by Step Solution

3.42 Rating (165 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Program plan Initialise the value of p with 2 Compute the value of 2 p 1 Call function the compu... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming Questions!