# Why $n=4$ the only integer satisfying :$-1+2^{n²+n+41}$ to be prime from $n=0$ to $n=40$?

Few research to know more about primality of Mersenne primes where the power of $2$ is Euler formula prime which it is defined as : $-1+2^{n²+n+41}$, it is well known that $n²+n+41$ is a prime number for $n < 41$ ,I have checked few computation to look primality of $-1+2^{n²+n+41}$ from n=0 to 40 I have got the only integer satisfing the primailty is $n=4$ , my question here is to ask if there is any exception property for $n=4$ than other over the titled list for which $-1+2^{n²+n+41}$ is a prime number ? . or probably primes of $-1+2^{n²+n+41}$ are rare !!!!

• The largest prime obtained via that polynomial is $1601$...there are only $15$ mersenne primes with exponents less than that, so chance alone seems to explain the phenomenon.
– lulu
Feb 6, 2018 at 12:07
• Monster math: there are about $250$ primes $≤1601$ and $15$ exponents of Mersenne primes. If you take a random list of $40$ primes $≤1601$ the expectation is that $\frac {15}{250}\times 40=2.4$ of these will be exponents of Mersenne primes...so observing exactly $1$ doesn't seem out of line.
– lulu
Feb 6, 2018 at 12:12

The primes of the form $2^p-1$ where $p$ is prime are called Mersenne primes and are quite rare. It is therefore very reasonable to me that few, or, as you write, only one, of the primes of the form $n^2+n+41$ is Mersenne.

In other words, this is just a numerical coincidence.

Primes grow to be fairly uncommon among large numbers. Exponential functions grow extremely fast. $2^{n^2 + n + 41} - 1$ grows even faster than that.

The first estimate for estimating how many primes you should find is a random one based on the prime number theorem: a number of size around $N$ is prime with "probability" $\frac{1}{\ln(N)}$.

Doing a quick and dirty calculation with mathematica, the expected number of primes you'd find in a sequence that grows that fast can be estimated by

$$\sum_{n=0}^{\infty} \frac{1}{\ln(2^{n^2 + n + 41} - 1)} \approx 0.355$$

so you're somewhat lucky that there was even one to find. (but the fact it appeared for a small value of $n$ rather than a large one is to be expected)

A more refined analysis could improve the estimate (e.g. accounting for the fact Mersenne numbers can't be even and/or the distribution of prime values of $n^2 + n + 41$), but I would expect it to still be a small constant. I believe Wagstaff's conjecture says that Mersenne primes don't have any features that would deviate significantly from this sort of statistical analysis.