# Wagstaff prime

Named after Samuel S. Wagstaff, Jr. 1989[1] Bateman, P. T., Selfridge, J. L., Wagstaff Jr., S. S. 43 3, 11, 43, 683 (213372531+1)/3 A000979

In number theory, a Wagstaff prime is a prime number p of the form

${\displaystyle p={{2^{q}+1} \over 3}}$

where q is an odd prime. Wagstaff primes are named after the mathematician Samuel S. Wagstaff Jr.; the prime pages credit François Morain for naming them in a lecture at the Eurocrypt 1990 conference. Wagstaff primes appear in the New Mersenne conjecture and have applications in cryptography.[clarification needed]

## Examples

The first three Wagstaff primes are 3, 11, and 43 because

{\displaystyle {\begin{aligned}3&={2^{3}+1 \over 3},\\[5pt]11&={2^{5}+1 \over 3},\\[5pt]43&={2^{7}+1 \over 3}.\end{aligned}}}

## Known Wagstaff primes

The first few Wagstaff primes are:

3, 11, 43, 683, 2731, 43691, 174763, 2796203, 715827883, 2932031007403, 768614336404564651, … (sequence A000979 in the OEIS)

As of October 2014, known exponents which produce Wagstaff primes or probable primes are:

3, 5, 7, 11, 13, 17, 19, 23, 31, 43, 61, 79, 101, 127, 167, 191, 199, 313, 347, 701, 1709, 2617, 3539, 5807, 10501, 10691, 11279, 12391, 14479, 42737, 83339,[2] (all known Wagstaff primes)
95369, 117239, 127031, 138937, 141079, 267017, 269987, 374321, 986191, 4031399, …, 13347311, 13372531 (Wagstaff probable primes) (sequence A000978 in the OEIS)

In February 2010, Tony Reix discovered the Wagstaff probable prime:

${\displaystyle {\frac {2^{4031399}+1}{3}}}$

which has 1,213,572 digits and was the 3rd biggest probable prime ever found at this date.[3]

In September 2013, Ryan Propper announced the discovery of two additional Wagstaff probable primes:[4]

${\displaystyle {\frac {2^{13347311}+1}{3}}}$

and

${\displaystyle {\frac {2^{13372531}+1}{3}}}$

Each is a probable prime with slightly more than 4 million decimal digits, it is not currently known whether there are any exponents between 4031399 and 13347311 that produce Wagstaff probable primes.

Note that when p is a Wagstaff prime, ${\displaystyle {\frac {2^{p}+1}{3}}}$ need not to be prime, first counterexample is p=683, and it is conjectured that if p is a Wagstaff prime and p>43, then ${\displaystyle {\frac {2^{p}+1}{3}}}$ is composite.

## Primality testing

These numbers are proven to be prime for the values of q up to 83339, those with q > 83339 are probable primes as of April 2015. The primality proof for q = 42737 was performed by François Morain in 2007 with a distributed ECPP implementation running on several networks of workstations for 743 GHz-days on an Opteron processor.[5] It was the third largest primality proof by ECPP from its discovery until March 2009.[6]

Currently, the fastest known algorithm for proving the primality of Wagstaff numbers is ECPP.

The LLR (Lucas-Lehmer-Riesel) tool by Jean Penné is used to find Wagstaff probable primes by means of the Vrba-Reix test, it is a PRP test based on the properties of a cycle of the digraph under x^2-2 modulo a Wagstaff number.

## Generalizations

It is natural to consider[7] more generally numbers of the form

${\displaystyle Q(b,n)={\frac {b^{n}+1}{b+1}}}$

where the base ${\displaystyle b\geq 2}$. Since for ${\displaystyle n}$ odd we have

${\displaystyle {\frac {b^{n}+1}{b+1}}={\frac {(-b)^{n}-1}{(-b)-1}}=R_{n}(-b)}$

these numbers are called "Wagstaff numbers base ${\displaystyle b}$", and sometimes considered[8] a case of the repunit numbers with negative base ${\displaystyle -b}$.

For some specific values of ${\displaystyle b}$, all ${\displaystyle Q(b,n)}$ (with a possible exception for very small ${\displaystyle n}$) are composite because of an "algebraic" factorization. Specifically, if ${\displaystyle b}$ has the form of a perfect power with odd exponent (like 8, 27, 32, 64, 125, 128, 216, 243, 343, 512, 729, 1000, etc. (sequence A070265 in the OEIS)), then the fact that ${\displaystyle x^{m}+1}$, with ${\displaystyle m}$ odd, is divisible by ${\displaystyle x+1}$ shows that ${\displaystyle Q(a^{m},n)}$ is divisible by ${\displaystyle a^{n}+1}$ in these special cases. Another case is ${\displaystyle b=4k^{4}}$, with k positive integer (like 4, 64, 324, 1024, 2500, 5184, etc. (sequence A141046 in the OEIS)), where we have the aurifeuillean factorization.

However, when ${\displaystyle b}$ does not admit an algebraic factorization, it is conjectured that an infinite number of ${\displaystyle n}$ values make ${\displaystyle Q(b,n)}$ prime, notice all ${\displaystyle n}$ are odd primes.

For ${\displaystyle b=10}$, the primes themselves have the following appearance: 9091, 909091, 909090909090909091, 909090909090909090909090909091, … (sequence A097209 in the OEIS), and these ns are: 5, 7, 19, 31, 53, 67, 293, 641, 2137, 3011, 268207, ... (sequence A001562 in the OEIS).

See [[Repunit#List_of_repunit_primes_base_%7F'"UNIQ--postMath-0000002F-QINU"'%7F|repunit]] for the list of the generalized Wagstaff primes base ${\displaystyle b}$. (Generalized Wagstaff primes base ${\displaystyle b}$ are generalized repunit primes base ${\displaystyle -b}$ with odd ${\displaystyle n}$)

Least prime p such that ${\displaystyle Q(n,p)}$ is prime are (starts with n = 2, 0 if no such p exists)

3, 3, 3, 5, 3, 3, 0, 3, 5, 5, 5, 3, 7, 3, 3, 7, 3, 17, 5, 3, 3, 11, 7, 3, 11, 0, 3, 7, 139, 109, 0, 5, 3, 11, 31, 5, 5, 3, 53, 17, 3, 5, 7, 103, 7, 5, 5, 7, 1153, 3, 7, 21943, 7, 3, 37, 53, 3, 17, 3, 7, 11, 3, 0, 19, 7, 3, 757, 11, 3, 5, 3, ... (sequence A084742 in the OEIS)

Least base b such that ${\displaystyle Q(b,prime(n))}$ is prime are (starts with n = 2)

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, ... (sequence A103795 in the OEIS)

## References

1. ^ Bateman, P. T.; Selfridge, J. L.; Wagstaff, Jr., S. S. (1989). "The New Mersenne Conjecture". American Mathematical Monthly. 96: 125–128. doi:10.2307/2323195. JSTOR 2323195.
2. ^ http://primes.utm.edu/top20/page.php?id=67
3. ^ PRP Records
4. ^ New Wagstaff PRP exponents, mersenneforum.org
5. ^ Comment by François Morain, The Prime Database: (242737 + 1)/3 at The Prime Pages.
6. ^ Caldwell, Chris, "The Top Twenty: Elliptic Curve Primality Proof", The Prime Pages
7. ^ Dubner, H. and Granlund, T.: Primes of the Form (bn + 1)/(b + 1), Journal of Integer Sequences, Vol. 3 (2000)
8. ^ Repunit, Wolfram MathWorld (Eric W. Weisstein)