Wagstaff Prime

Author

Eric W. Weisstein
April 19, 2010

This notebook downloaded from http://mathworld.wolfram.com/notebooks/PrimeNumbers/WagstaffPrime.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/WagstaffPrime.html.

©2010 Wolfram Research, Inc. except for portions noted otherwise

Search

Select[Prime[Range[100]],PrimeQ[(2^#+1)/3]&]//Timing

Select[Prime[Range[10^3]],PrimeQ[(2^#+1)/3]&]//Timing

Position[Range[100],_?(PrimeQ[(2^Prime[#]+1)/3]&)]//Flatten

Table

Length[wag={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,95369,117239,127031,138937,141079,267017,269987,374321,986191,4031399}]

Grid[{#,N[w=(2^#+1)/3,3],IntegerLength[w]}&/@wag,Dividers->All,Alignment->Right]

Print[{#,PrimeQ[(2^#+1)/3]//Timing}]&/@wag