Question: Hi, can someone please provide me this code in Java, but while writing it can you make it so that it can compute the fastest
Write a program to find all the Mersenne Prime numbers between 3 and 263-1. A Mersenne Prime is a prime number that is of the form 2n-1. But not all values of this form are prime. Note that in order to test these numbers, you will have to use the "long" data type instead of "int" because the numbers become too large after 231-1. Your program should print all the powers of 2 minus 1 and state if the number is a Mersenne Prime or not. Measure the running time of your program using the System.currentTimeMillis() method to give you the current time in milliseconds at the beginning and end of your program. The difference between the start and end times is the running time
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
