Mersenne prime

In mathematics, a Mersenne prime is a prime number that is one less than a power of two. That is, it is a prime number of the form $M_{n} = 2^{n} − 1$ for some integer $n$. They are named after Marin Mersenne, a French Minim friar, who studied them in the early 17th century. If $n$ is a composite number then so is $2^{n} − 1$. Therefore, an equivalent definition of the Mersenne primes is that they are the prime numbers of the form $M_{p} = 2^{p} − 1$ for some prime $p$.

The exponents $n$ which give Mersenne primes are 2, 3, 5, 7, 13, 17, 19, 31, ... and the resulting Mersenne primes are 3, 7, 31, 127, 8191, 131071, 524287, 2147483647, ... .

Numbers of the form $M_{n} = 2^{n} − 1$ without the primality requirement may be called Mersenne numbers. Sometimes, however, Mersenne numbers are defined to have the additional requirement that $n$ be prime. The smallest composite Mersenne number with prime exponent n is 211 − 1 = 2047 = 23 × 89.

Mersenne primes were studied in antiquity because of their close connection to perfect numbers: the Euclid–Euler theorem asserts a one-to-one correspondence between even perfect numbers and Mersenne primes. Many of the largest known primes are Mersenne primes because Mersenne numbers are easier to check for primality.

, 51 Mersenne primes are known. The largest known prime number, 282,589,933 − 1, is a Mersenne prime. Since 1997, all newly found Mersenne primes have been discovered by the Great Internet Mersenne Prime Search, a distributed computing project. In December 2020, a major milestone in the project was passed after all exponents below 100 million were checked at least once.

About Mersenne primes
Many fundamental questions about Mersenne primes remain unresolved. It is not even known whether the set of Mersenne primes is finite or infinite.

The Lenstra–Pomerance–Wagstaff conjecture claims that there are infinitely many Mersenne primes and predicts their order of growth and frequency: For every number n, there should on average be about $$e^\gamma\cdot\log_2(10)$$ ≈ 5.92 primes p with n decimal digits (i.e. 10n-1 < p < 10n) for which $$M_p$$ is prime.

It is also not known whether infinitely many Mersenne numbers with prime exponents are composite, although this would follow from widely believed conjectures about prime numbers, for example, the infinitude of Sophie Germain primes congruent to 3 (mod 4). For these primes $p$, $2p + 1$ (which is also prime) will divide $M_{p}$, for example, $23 | M_{11}$, $47 | M_{23}$, $167 | M_{83}$, $263 | M_{131}$, $359 | M_{179}$, $383 | M_{191}$, $479 | M_{239}$, and $503 | M_{251}$. Since for these primes $p$, $2p + 1$ is congruent to 7 mod 8, so 2 is a quadratic residue mod $2p + 1$, and the multiplicative order of 2 mod $2p + 1$ must divide $\frac{(2p+1)-1}{2} = p$. Since $p$ is a prime, it must be $p$ or 1. However, it cannot be 1 since $$\Phi_1(2) = 1$$ and 1 has no prime factors, so it must be $p$. Hence, $2p + 1$ divides $$\Phi_p(2) = 2^p-1$$ and $$2^p-1 = M_p$$ cannot be prime. The first four Mersenne primes are $M_{2} = 3$, $M_{3} = 7$, $M_{5} = 31$ and $M_{7} = 127$ and because the first Mersenne prime starts at $M_{2}$, all Mersenne primes are congruent to 3 (mod 4). Other than $M_{0} = 0$ and $M_{1} = 1$, all other Mersenne numbers are also congruent to 3 (mod 4). Consequently, in the prime factorization of a Mersenne number ( $&ge; M_{2}$ ) there must be at least one prime factor congruent to 3 (mod 4).

A basic theorem about Mersenne numbers states that if $M_{p}$ is prime, then the exponent $p$ must also be prime. This follows from the identity $$\begin{align} 2^{ab}-1 &=(2^a-1)\cdot \left(1+2^a+2^{2a}+2^{3a}+\cdots+2^{(b-1)a}\right)\\ &=(2^b-1)\cdot \left(1+2^b+2^{2b}+2^{3b}+\cdots+2^{(a-1)b}\right). \end{align}$$ This rules out primality for Mersenne numbers with a composite exponent, such as $M_{4} = 2^{4} − 1 = 15 = 3 × 5 = (2^{2} − 1) × (1 + 2^{2})$.

Though the above examples might suggest that $M_{p}$ is prime for all primes $p$, this is not the case, and the smallest counterexample is the Mersenne number



The evidence at hand suggests that a randomly selected Mersenne number is much more likely to be prime than an arbitrary randomly selected odd integer of similar size. Nonetheless, prime values of $M_{p}$ appear to grow increasingly sparse as $p$ increases. For example, eight of the first 11 primes $p$ give rise to a Mersenne prime $M_{p}$ (the correct terms on Mersenne's original list), while $M_{p}$ is prime for only 43 of the first two million prime numbers (up to 32,452,843).

The current lack of any simple test to determine whether a given Mersenne number is prime makes the search for Mersenne primes a difficult task, since Mersenne numbers grow very rapidly. The Lucas–Lehmer primality test (LLT) is an efficient primality test that greatly aids this task, making it much easier to test the primality of Mersenne numbers than that of most other numbers of the same size. The search for the largest known prime has somewhat of a cult following. Consequently, a large amount of computer power has been expended searching for new Mersenne primes, much of which is now done using distributed computing.

Arithmetic modulo a Mersenne number is particularly efficient on a binary computer, making them popular choices when a prime modulus is desired, such as the Park–Miller random number generator. To find a primitive polynomial of Mersenne number order requires knowing the factorization of that number, so Mersenne primes allow one to find primitive polynomials of very high order. Such primitive trinomials are used in pseudorandom number generators with very large periods such as the Mersenne twister, generalized shift register and Lagged Fibonacci generators.

Perfect numbers
Mersenne primes $M_{11} = 2^{11} − 1 = 2047 = 23 × 89$ are closely connected to perfect numbers. In the 4th century BC, Euclid proved that if $M_{p}$ is prime, then $2^{p} − 1$) is a perfect number. In the 18th century, Leonhard Euler proved that, conversely, all even perfect numbers have this form. This is known as the Euclid–Euler theorem. It is unknown whether there are any odd perfect numbers.

An alternative form of Perfect Numbers (not affecting the essence): If $$(M=2^n-1)$$ is a prime number, then $$P=M(M+1)/2$$ is a Perfect Number. (Perfect Numbers are Triangular Numbers whose base is a Mersenne Prime.)

History
Mersenne primes take their name from the 17th-century French scholar Marin Mersenne, who compiled what was supposed to be a list of Mersenne primes with exponents up to 257. The exponents listed by Mersenne in 1644 were as follows:


 * 2, 3, 5, 7, 13, 17, 19, 31, 67, 127, 257.

His list replicated the known primes of his time with exponents up to 19. His next entry, 31, was correct, but the list then became largely incorrect, as Mersenne mistakenly included $2^{p − 1}(2^{p} − 1$ and $M_{67}$ (which are composite) and omitted $M_{257}$, $M_{61}$, and $M_{89}$ (which are prime). Mersenne gave little indication of how he came up with his list.

Édouard Lucas proved in 1876 that $M_{107}$ is indeed prime, as Mersenne claimed. This was the largest known prime number for 75 years until 1951, when Ferrier found a larger prime, $$(2^{148}+1)/17$$, using a desk calculating machine. $M_{127}$ was determined to be prime in 1883 by Ivan Mikheevich Pervushin, though Mersenne claimed it was composite, and for this reason it is sometimes called Pervushin's number. This was the second-largest known prime number, and it remained so until 1911. Lucas had shown another error in Mersenne's list in 1876 by demonstrating that $M_{61}$ was composite without finding a factor. No factor was found until a famous talk by Frank Nelson Cole in 1903. Without speaking a word, he went to a blackboard and raised 2 to the 67th power, then subtracted one, resulting in the number 147,573,952,589,676,412,927. On the other side of the board, he multiplied 193,707,721 × 761,838,257,287 and got the same number, then returned to his seat (to applause) without speaking. He later said that the result had taken him "three years of Sundays" to find. A correct list of all Mersenne primes in this number range was completed and rigorously verified only about three centuries after Mersenne published his list.

Searching for Mersenne primes
Fast algorithms for finding Mersenne primes are available, and, the six largest known prime numbers are Mersenne primes.

The first four Mersenne primes $M_{67}$, $M_{2} = 3$, $M_{3} = 7$ and $M_{5} = 31$ were known in antiquity. The fifth, $M_{7} = 127$, was discovered anonymously before 1461; the next two ($M_{13} = 8191$ and $M_{17}$) were found by Pietro Cataldi in 1588. After nearly two centuries, $M_{19}$ was verified to be prime by Leonhard Euler in 1772. The next (in historical, not numerical order) was $M_{31}$, found by Édouard Lucas in 1876, then $M_{127}$ by Ivan Mikheevich Pervushin in 1883. Two more ($M_{61}$ and $M_{89}$) were found early in the 20th century, by R. E. Powers in 1911 and 1914, respectively.

The most efficient method presently known for testing the primality of Mersenne numbers is the Lucas–Lehmer primality test. Specifically, it can be shown that for prime $M_{107}$, $p > 2$ is prime if and only if $M_{p} = 2^{p} − 1$ divides $M_{p}$, where $S_{p − 2}$ and $S_{0} = 4$ for $S_{k} = (S_{k − 1})^{2} − 2$.

During the era of manual calculation, all the exponents up to and including 257 were tested with the Lucas–Lehmer test and found to be composite. A notable contribution was made by retired Yale physics professor Horace Scudder Uhler, who did the calculations for exponents 157, 167, 193, 199, 227, and 229. Unfortunately for those investigators, the interval they were testing contains the largest known relative gap between Mersenne primes: the next Mersenne prime exponent, 521, would turn out to be more than four times as large as the previous record of 127.

The search for Mersenne primes was revolutionized by the introduction of the electronic digital computer. Alan Turing searched for them on the Manchester Mark 1 in 1949, but the first successful identification of a Mersenne prime, $k > 0$, by this means was achieved at 10:00 pm on January 30, 1952, using the U.S. National Bureau of Standards Western Automatic Computer (SWAC) at the Institute for Numerical Analysis at the University of California, Los Angeles, under the direction of D. H. Lehmer, with a computer search program written and run by Prof. R. M. Robinson. It was the first Mersenne prime to be identified in thirty-eight years; the next one, $M_{521}$, was found by the computer a little less than two hours later. Three more — $M_{607}$, $M_{1279}$, and $M_{2203}$ — were found by the same program in the next several months. $M_{2281}$ was the first prime discovered with more than 1000 digits, $M_{4,423}$ was the first with more than 10,000, and $M_{44,497}$ was the first with more than a million. In general, the number of digits in the decimal representation of $M_{6,972,593}$ equals $M_{n}$, where $⌊n × log_{10}2⌋ + 1$ denotes the floor function (or equivalently $⌊x⌋$).

In September 2008, mathematicians at UCLA participating in the Great Internet Mersenne Prime Search (GIMPS) won part of a $100,000 prize from the Electronic Frontier Foundation for their discovery of a very nearly 13-million-digit Mersenne prime. The prize, finally confirmed in October 2009, is for the first known prime with at least 10 million digits. The prime was found on a Dell OptiPlex 745 on August 23, 2008. This was the eighth Mersenne prime discovered at UCLA.

On April 12, 2009, a GIMPS server log reported that a 47th Mersenne prime had possibly been found. The find was first noticed on June 4, 2009, and verified a week later. The prime is 242,643,801 − 1. Although it is chronologically the 47th Mersenne prime to be discovered, it is smaller than the largest known at the time, which was the 45th to be discovered.

On January 25, 2013, Curtis Cooper, a mathematician at the University of Central Missouri, discovered a 48th Mersenne prime, 257,885,161 − 1 (a number with 17,425,170 digits), as a result of a search executed by a GIMPS server network.

On January 19, 2016, Cooper published his discovery of a 49th Mersenne prime, 274,207,281 − 1 (a number with 22,338,618 digits), as a result of a search executed by a GIMPS server network. This was the fourth Mersenne prime discovered by Cooper and his team in the past ten years.

On September 2, 2016, the Great Internet Mersenne Prime Search finished verifying all tests below M37,156,667, thus officially confirming its position as the 45th Mersenne prime.

On January 3, 2018, it was announced that Jonathan Pace, a 51-year-old electrical engineer living in Germantown, Tennessee, had found a 50th Mersenne prime, 277,232,917 − 1 (a number with 23,249,425 digits), as a result of a search executed by a GIMPS server network. The discovery was made by a computer in the offices of a church in the same town.

On December 21, 2018, it was announced that The Great Internet Mersenne Prime Search (GIMPS) discovered the largest known prime number, 282,589,933 − 1, having 24,862,048 digits. A computer volunteered by Patrick Laroche from Ocala, Florida made the find on December 7, 2018.

In late 2020, GIMPS began using a new technique to rule out potential Mersenne primes called the Probable prime (PRP) test, based on development from Robert Gerbicz in 2017, and a simple way to verify tests developed by Krzysztof Pietrzak in 2018. Due to the low error rate and ease of proof, this nearly halved the computing time to rule out potential primes over the Lucas-Lehmer test (as two users would no longer have to perform the same test to confirm the other's result), although exponents passing the PRP test still require one to confirm their primality.

Theorems about Mersenne numbers
Mersenne numbers are 0, 1, 3, 7, 15, 31, 63, ... .


 * 1) If $⌊log_{10}M_{n}⌋ + 1$ and $p$ are natural numbers such that $a$ is prime, then $a^{p} − 1$ or $a = 2$.
 * 2) * Proof: $p = 1$. Then $a ≡ 1 (mod a − 1)$, so $a^{p} ≡ 1 (mod a − 1)$. Thus $a^{p} − 1 ≡ 0 (mod a − 1)$. However, $a − 1 | a^{p} − 1$ is prime, so $a^{p} − 1$ or $a − 1 = a^{p} − 1$. In the former case, $a − 1 = ±1$, hence $a = a^{p}$ (which is a contradiction, as neither −1 nor 0 is prime) or $a = 0, 1$ In the latter case, $p = 1.$ or $a = 2$. If $a = 0$, however, $a = 0$ which is not prime. Therefore, $0^{p} − 1 = 0 − 1 = −1$.
 * 3) If $a = 2$ is prime, then $p$ is prime.
 * 4) * Proof: Suppose that $p$ is composite, hence can be written $2^{p} − 1$ with $a$ and $p = ab$. Then $b > 1$ $2^{p} − 1$ $= 2^{ab} − 1$ $= (2^{a})^{b} − 1$ so $= (2^{a} − 1) ( (2^{a})^{b−1} + (2^{a})^{b−2} + ... + 2^{a} + 1 )$ is composite. By contraposition, if $2^{p} − 1$ is prime then p is prime.
 * 5) If $p$ is an odd prime, then every prime $q$ that divides $2^{p} − 1$ must be 1 plus a multiple of $2^{p} − 1$. This holds even when $2p$ is prime.
 * 6) * For example, 25 − 1 = 31 is prime, and . A composite example is 211 − 1 = 23 × 89, where  and.
 * 7) * Proof: By Fermat's little theorem, $q$ is a factor of $2^{p} − 1$. Since $q$ is a factor of $2^{q−1} − 1$, for all positive integers $2^{p} − 1$, $q$ is also a factor of $c$. Since $p$ is prime and $q$ is not a factor of 21 − 1, $p$ is also the smallest positive integer $x$ such that $q$ is a factor of $2^{pc} − 1$. As a result, for all positive integers $x$, $q$ is a factor of $2^{x} − 1$ if and only if $p$ is a factor of $x$. Therefore, since $q$ is a factor of $2^{x} − 1$, $p$ is a factor of $2^{q−1} − 1$ so $q − 1$. Furthermore, since $q$ is a factor of $q ≡ 1 (mod p)$, which is odd, $q$ is odd. Therefore, $2^{p} − 1$.
 * 8) * This fact leads to a proof of Euclid's theorem, which asserts the infinitude of primes, distinct from the proof written by Euclid: for every odd prime $p$, all primes dividing $q ≡ 1 (mod 2p)$ are larger than $p$; thus there are always larger primes than any particular prime.
 * 9) * It follows from this fact that for every prime $2^{p} − 1$, there is at least one prime of the form $p > 2$ less than or equal to $M_{p}$, for some integer $k$.
 * 10) If $p$ is an odd prime, then every prime $q$ that divides $2kp+1$ is congruent to ±1 (mod 8).
 * 11) * Proof: $2^{p} − 1$, so $2^{p+1} ≡ 2 (mod q)$ is a square root of $2^{{{sfrac|1|2}}(p+1)}$. By quadratic reciprocity, every prime modulus in which the number 2 has a square root is congruent to ±1 (mod 8).
 * 12) A Mersenne prime cannot be a Wieferich prime.
 * 13) * Proof: We show if $2 mod q$ is a Mersenne prime, then the congruence $p = 2^{m} − 1$ does not hold. By Fermat's little theorem, $2^{p−1} ≡ 1 (mod p^{2})$. Therefore, one can write $m | p − 1$. If the given congruence is satisfied, then $p − 1 = mλ$, therefore $p^{2} | 2^{mλ} − 1$ $0 ≡ 2^{mλ} − 1⁄2^{m} − 1$ $= 1 + 2^{m} + 2^{2m} + ... + 2^{(λ − 1)m}$. Hence $≡ λ mod (2^{m} − 1)$, and therefore $p | λ$ which is impossible.
 * 14) If $m$ and $n$ are natural numbers then $m$ and $n$ are coprime if and only if $−1 = 0 (mod p)$ and $2^{m} − 1$ are coprime. Consequently, a prime number divides at most one prime-exponent Mersenne number. That is, the set of pernicious Mersenne numbers is pairwise coprime.
 * 15) If $p$ and $2^{n} − 1$ are both prime (meaning that $p$ is a Sophie Germain prime), and $p$ is congruent to 3 (mod 4), then $2p + 1$ divides $2p + 1$.
 * 16) * Example: 11 and 23 are both prime, and, so 23 divides 211 − 1.
 * 17) * Proof: Let $q$ be $2^{p} − 1$. By Fermat's little theorem, $2p + 1$, so either $2^{2p} ≡ 1 (mod q)$ or $2^{p} ≡ 1 (mod q)$. Supposing latter true, then $2^{p} ≡ −1 (mod q)$, so −2 would be a quadratic residue mod $q$. However, since $p$ is congruent to 3 (mod 4), $q$ is congruent to 7 (mod 8) and therefore 2 is a quadratic residue mod $q$. Also since $q$ is congruent to 3 (mod 4), −1 is a quadratic nonresidue mod $q$, so −2 is the product of a residue and a nonresidue and hence it is a nonresidue, which is a contradiction. Hence, the former congruence must be true and $2^{p+1} = (2^{{{sfrac|1|2}}(p + 1)})^{2} ≡ −2 (mod q)$ divides $M_{p}$.
 * 18) All composite divisors of prime-exponent Mersenne numbers are strong pseudoprimes to the base 2.
 * 19) With the exception of 1, a Mersenne number cannot be a perfect power. That is, and in accordance with Mihăilescu's theorem, the equation $2p + 1$ has no solutions where $m$, $n$, and $k$ are integers with $2^{m} − 1 = n^{k}$ and $m > 1$.
 * 20) The Mersenne number sequence is a member of the family of Lucas sequences. It is $k > 1$(3, 2). That is, Mersenne number $U_{n}$ with $m_{n} = 3m_{n-1} - 2m_{n-2}$ and $m_{0} = 0$.

List of known Mersenne primes
, the 51 known Mersenne primes are 2p − 1 for the following p:
 * 2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127, 521, 607, 1279, 2203, 2281, 3217, 4253, 4423, 9689, 9941, 11213, 19937, 21701, 23209, 44497, 86243, 110503, 132049, 216091, 756839, 859433, 1257787, 1398269, 2976221, 3021377, 6972593, 13466917, 20996011, 24036583, 25964951, 30402457, 32582657, 37156667, 42643801, 43112609, 57885161, 74207281, 77232917, 82589933.

Factorization of composite Mersenne numbers
Since they are prime numbers, Mersenne primes are divisible only by 1 and themselves. However, not all Mersenne numbers are Mersenne primes. Mersenne numbers are very good test cases for the special number field sieve algorithm, so often the largest number factorized with this algorithm has been a Mersenne number. , $m_{1} = 1$ is the record-holder, having been factored with a variant of the special number field sieve that allows the factorization of several numbers at once. See integer factorization records for links to more information. The special number field sieve can factorize numbers with more than one large factor. If a number has only one very large factor then other algorithms can factorize larger numbers by first finding small factors and then running a primality test on the cofactor. , the largest completely factored number (with probable prime factors allowed) is $21,193 − 1$, where $q$ is a 3,829,294-digit probable prime. It was discovered by a GIMPS participant with nickname "Funky Waddle". , the Mersenne number M1277 is the smallest composite Mersenne number with no known factors; it has no prime factors below 268, and is very unlikely to have any factors below 1065 (~2216).

The table below shows factorizations for the first 20 composite Mersenne numbers.

The number of factors for the first 500 Mersenne numbers can be found at.

Mersenne numbers in nature and elsewhere
In the mathematical problem Tower of Hanoi, solving a puzzle with an $2^{12,720,787} − 1 = 1,119,429,257 × 175,573,124,547,437,977 × 8,480,999,878,421,106,991 × q$-disc tower requires $p$ steps, assuming no mistakes are made. The number of rice grains on the whole chessboard in the wheat and chessboard problem is $M_{p}$.

The asteroid with minor planet number 8191 is named 8191 Mersenne after Marin Mersenne, because 8191 is a Mersenne prime (3 Juno, 7 Iris, 31 Euphrosyne and 127 Johanna having been discovered and named during the 19th century).

In geometry, an integer right triangle that is primitive and has its even leg a power of 2 ( $M_{p}$ ) generates a unique right triangle such that its inradius is always a Mersenne number. For example, if the even leg is $n$ then because it is primitive it constrains the odd leg to be $M_{n}$, the hypotenuse to be $M_{64}$ and its inradius to be $&ge; 4$.

Mersenne–Fermat primes
A Mersenne–Fermat number is defined as $2^{n + 1}$ with $4^{n} − 1$ prime, $4^{n} + 1$ natural number, and can be written as $2^{n} − 1$. When $1⁄2^{p^{r}} − 1|2^{p^{r − 1}} − 1|undefined|undefined$, it is a Mersenne number. When $p$, it is a Fermat number. The only known Mersenne–Fermat primes with $r$ are
 * $MF(p, r)$ and $r = 1$.

In fact, $p = 2$, where $r > 1$ is the cyclotomic polynomial.

Generalizations
The simplest generalized Mersenne primes are prime numbers of the form $MF(2, 2), MF(2, 3), MF(2, 4), MF(2, 5), MF(3, 2), MF(3, 3), MF(7, 2),$, where $MF(59, 2)$ is a low-degree polynomial with small integer coefficients. An example is $MF(p, r) = Φ_{p^{r}}(2)|undefined$, in this case, $Φ$, and $f(2^{n})$; another example is $f(x)$, in this case, $2^{64} − 2^{32} + 1$, and $n = 32$.

It is also natural to try to generalize primes of the form $f(x) = x^{2} − x + 1$ to primes of the form $2^{192} − 2^{64} − 1$ (for $n = 64$ and $f(x) = x^{3} − x − 1$). However (see also theorems above), $2^{n} − 1$ is always divisible by $b^{n} − 1$, so unless the latter is a unit, the former is not a prime. This can be remedied by allowing b to be an algebraic integer instead of an integer:

Complex numbers
In the ring of integers (on real numbers), if $b ≠ 2$ is a unit, then $n > 1$ is either 2 or 0. But $b^{n} − 1$ are the usual Mersenne primes, and the formula $b − 1$ does not lead to anything interesting (since it is always −1 for all $b − 1$). Thus, we can regard a ring of "integers" on complex numbers instead of real numbers, like Gaussian integers and Eisenstein integers.

Gaussian Mersenne primes
If we regard the ring of Gaussian integers, we get the case $b$ and $2^{n} − 1$, and can ask (WLOG) for which $0^{n} − 1$ the number $n > 0$ is a Gaussian prime which will then be called a Gaussian Mersenne prime.

$b = 1 + i$ is a Gaussian prime for the following $b = 1 − i$:


 * 2, 3, 5, 7, 11, 19, 29, 47, 73, 79, 113, 151, 157, 163, 167, 239, 241, 283, 353, 367, 379, 457, 997, 1367, 3041, 10141, 14699, 27529, 49207, 77291, 85237, 106693, 160423, 203789, 364289, 991961, 1203793, 1667321, 3704053, 4792057, ...

Like the sequence of exponents for usual Mersenne primes, this sequence contains only (rational) prime numbers.

As for all Gaussian primes, the norms (that is, squares of absolute values) of these numbers are rational primes:


 * 5, 13, 41, 113, 2113, 525313, 536903681, 140737471578113, ....

Eisenstein Mersenne primes
One may encounter cases where such a Mersenne prime is also an Eisenstein prime, being of the form $n$ and $(1 + i)^{n} − 1$. In these cases, such numbers are called Eisenstein Mersenne primes.

$(1 + i)^{n} − 1$ is an Eisenstein prime for the following $n$:


 * 2, 5, 7, 11, 17, 19, 79, 163, 193, 239, 317, 353, 659, 709, 1049, 1103, 1759, 2029, 5153, 7541, 9049, 10453, 23743, 255361, 534827, 2237561, ...

The norms (that is, squares of absolute values) of these Eisenstein primes are rational primes:


 * 7, 271, 2269, 176419, 129159847, 1162320517, ...

Repunit primes
The other way to deal with the fact that $b = 1 + ω$ is always divisible by $b = 1 − ω$, it is to simply take out this factor and ask which values of $(1 + ω)^{n} − 1$ make
 * $$\frac{b^n-1}{b-1}$$

be prime. (The integer $n$ can be either positive or negative.) If, for example, we take $b^{n} − 1$, we get $b − 1$ values of:
 * 2, 19, 23, 317, 1031, 49081, 86453, 109297, 270343, ..., corresponding to primes 11, 1111111111111111111, 11111111111111111111111, ....

These primes are called repunit primes. Another example is when we take $n$, we get $b$ values of:
 * 2, 5, 11, 109, 193, 1483, 11353, 21419, 21911, 24071, 106859, 139739, ..., corresponding to primes −11, 19141, 57154490053, ....

It is a conjecture that for every integer $b = 10$ which is not a perfect power, there are infinitely many values of $n$ such that $b = −12$ is prime. (When $n$ is a perfect power, it can be shown that there is at most one $b$ value such that $n$ is prime)

Least $b^{n} − 1⁄b − 1$ such that $b$ is prime are (starting with $n$, $b^{n} − 1⁄b − 1$ if no such $n$ exists)
 * 2, 3, 2, 3, 2, 5, 3, 0, 2, 17, 2, 5, 3, 3, 2, 3, 2, 19, 3, 3, 2, 5, 3, 0, 7, 3, 2, 5, 2, 7, 0, 3, 13, 313, 2, 13, 3, 349, 2, 3, 2, 5, 5, 19, 2, 127, 19, 0, 3, 4229, 2, 11, 3, 17, 7, 3, 2, 3, 2, 7, 3, 5, 0, 19, 2, 19, 5, 3, 2, 3, 2, ...

For negative bases $b^{n} − 1⁄b − 1$, they are (starting with $b = 2$, $0$ if no such $n$ exists)
 * 3, 2, 2, 5, 2, 3, 2, 3, 5, 5, 2, 3, 2, 3, 3, 7, 2, 17, 2, 3, 3, 11, 2, 3, 11, 0, 3, 7, 2, 109, 2, 5, 3, 11, 31, 5, 2, 3, 53, 17, 2, 5, 2, 103, 7, 5, 2, 7, 1153, 3, 7, 21943, 2, 3, 37, 53, 3, 17, 2, 7, 2, 3, 0, 19, 7, 3, 2, 11, 3, 5, 2, ... (notice this OEIS sequence does not allow $b$)

Least base $b = −2$ such that $0$ is prime are
 * 2, 2, 2, 2, 5, 2, 2, 2, 10, 6, 2, 61, 14, 15, 5, 24, 19, 2, 46, 3, 11, 22, 41, 2, 12, 22, 3, 2, 12, 86, 2, 7, 13, 11, 5, 29, 56, 30, 44, 60, 304, 5, 74, 118, 33, 156, 46, 183, 72, 606, 602, 223, 115, 37, 52, 104, 41, 6, 338, 217, ...

For negative bases $n$, they are
 * 3, 2, 2, 2, 2, 2, 2, 2, 2, 7, 2, 16, 61, 2, 6, 10, 6, 2, 5, 46, 18, 2, 49, 16, 70, 2, 5, 6, 12, 92, 2, 48, 89, 30, 16, 147, 19, 19, 2, 16, 11, 289, 2, 12, 52, 2, 66, 9, 22, 5, 489, 69, 137, 16, 36, 96, 76, 117, 26, 3, ...

Other generalized Mersenne primes
Another generalized Mersenne number is
 * $$\frac{a^n-b^n}{a-b}$$

with $a$, $b$ any coprime integers, $n = 2$ and $b$. (Since $b^{prime(n)} − 1⁄b − 1$ is always divisible by $b$, the division is necessary for there to be any chance of finding prime numbers.) We can ask which $a$ makes this number prime. It can be shown that such $b$ must be primes themselves or equal to 4, and $n$ can be 4 if and only if $a > 1$ and $−a < b < a$ is prime. It is a conjecture that for any pair $a^{n} − b^{n}$ such that $n$ and $n$ are not both perfect $x$th powers for any $a$ and $a − b$ is not a perfect fourth power, there are infinitely many values of $b$ such that $U_{n}(a + b, ab)$ is prime. However, this has not been proved for any single value of $x^{2} − (a + b)x + ab = 0$.


 * Note: if $a + b = 1$ and $r$ is even, then the numbers $r$ are not included in the corresponding OEIS sequence.

When $a^{2} + b^{2}$, it is $a^{4} − b^{4}⁄a − b = (a + b)(a^{2} + b^{2})$, a difference of two consecutive perfect $n$th powers, and if $(a, b)$ is prime, then $a$ must be $(x + 1, −x)$, because it is divisible by $x^{2} + (x + 1)^{2}$.

Least $b$ such that $(a, b)$ is prime are
 * 2, 2, 2, 3, 2, 2, 7, 2, 2, 3, 2, 17, 3, 2, 2, 5, 3, 2, 5, 2, 2, 229, 2, 3, 3, 2, 3, 3, 2, 2, 5, 3, 2, 3, 2, 2, 3, 3, 2, 7, 2, 3, 37, 2, 3, 5, 58543, 2, 3, 2, 2, 3, 2, 2, 3, 2, 5, 3, 4663, 54517, 17, 3, 2, 5, 2, 3, 3, 2, 2, 47, 61, 19, ...

Least $r$ such that $−4ab$ is prime are
 * 1, 1, 1, 1, 5, 1, 1, 1, 5, 2, 1, 39, 6, 4, 12, 2, 2, 1, 6, 17, 46, 7, 5, 1, 25, 2, 41, 1, 12, 7, 1, 7, 327, 7, 8, 44, 26, 12, 75, 14, 51, 110, 4, 14, 49, 286, 15, 4, 39, 22, 109, 367, 22, 67, 27, 95, 80, 149, 2, 142, 3, 11, ...