A Mersenne prime is a prime number of the form $2^n−1$. Produce a list of those n, which are at most 1,000, for which $2^n − 1$ is prime
I am able to find the list of prime numbers:
Select[Table[m = 2^n - 1, {n, Range[1000]}], PrimeQ]
{3, 7, 31, 127, 8191, 131071, 524287, 2147483647...etc.
How can I make a list of their corresponding "n" values?
n
and the select criteraPrimeQ[2^# - 1]&
$\endgroup$With[{list = Range[1000]}, Pick[list, PrimeQ[2^list - 1]]]
. $\endgroup$