# Probability that a Mersenne number is prime

Let $p$ be a prime and let $M_p = 2^p-1$ be a (Mersenne) number. Is there any known result on the probability that $M_p$ is prime? In particular is it known whether the probability tends to $1$ as $p \to \infty$? If so, is there any known lower bound for the asymptotic rate with which this probability tends $1$? Thank you.

• If you had looked at the wikipedia page on Mersenne primes, you would have come across the statement It is not even known whether the set of Mersenne primes is finite or infinite. – Harald Hanche-Olsen Nov 28 '14 at 19:30
• The Wikipedia page gives no citation for that statement. Though there are far more reliable sources backing that up. – Robert Soupe Nov 28 '14 at 19:38
• The available data suggest that the probability tends to $0$, not $1$. – TonyK Nov 28 '14 at 19:39
• Indeed. Consider the recent confirmation of the 44th Mersenne prime. Since $\pi(32582657) = 2007537$, let's assume that for any two million consecutive primes only 44 of them correspond to Mersenne primes. That would mean less than 1% and that's being generous! – Robert Soupe Nov 28 '14 at 19:44
• A number is either prime or not, so it's individual probability is 0 or 1. It's more rigorous to talk about the density of Mersenne primes for $p\in[0, P]$ as a function of $P$. If you have an asymtotic representation of this function, you can look at its derivative, which you can then define as $M_p$. – Vortico Nov 28 '14 at 19:44

I'm pretty sure there is no such result: it is not even known that infinitely many $M_p$ are primes, or that infinitely many are composite.

• So particularly, in your opinion, a result like "the probability tends to 1" would imply that there are infinitely many such primes? – user188688 Nov 28 '14 at 19:33
• It's hardly a matter of opinion. If there were only finitely many, the probability would go to $0$. – Robert Israel Nov 28 '14 at 19:47
• I see now. Thanks. – user188688 Nov 28 '14 at 19:53
• Could the statement "the probability tends to 1" also imply that there are finitely many composites too? – user188688 Nov 28 '14 at 20:11

For a large prime $p$, the probability of $2^p−1$ being prime is about $\frac{\log{p}}{p}$.

There was a quotation of the "Wagstaff Mersenne Conjecture", with the claim that for large prime, the probability that $2^p - 1$ is prime is supposed to be about $\frac{\log{p}}{p}$. Since the probability that n is prime is about $\frac{1}{\log{n}}$ this would make the probability that $2^n - 1$ is prime for integer n about $1/n$. The number of Mersenne primes $2^p - 1$ with p ≤ M would be about log M.

$\log M (2 / \log{2})$, which is about 2.9 times bigger, seems to be a much better estimate for the number of Mersenne primes with exponents ≤ M. It overestimates the number of Mersenne primes by about 3 to 8 in the range where they are known. Some deviation is to be expected. If we picked an odd number near $2^n$ for every n, we would expect the same number of primes.

So with the known data, $\frac{2\log_2{p}}{p}$ seems to be a better estimate for the probability that $2^p - 1$ is prime if p is a prime.

For the already mentioned reason, this probability question can't be definitively solved right now. But for fun you could assume one of the conjectures about the distribution of Mersenne primes (I think Wagstaff conjectured an asymptote of C*loglog(x) for some funky constant C?) and see what that brings.