Quote:
Originally Posted by paulunderwood
Code:
wag(q)=W=(2^q+1)/3;S0=S=Mod((2^(q2)+1)/3,W);for(i=2,q,S=S^22);S==S0;

4*S = (2^q+4)/3 == 1 mod W.
So S = 1/4 mod W
Therefore
S0 = 1/4
S1 = (1/4)^2  2 = 31/16
S2 = (31/16)^2  2 = 449/256
....
S_{q1} = X/4^2^(q1). This will be X if W is 4PRP  aren't all Wagstaff numbers? So it remains to show X = 1 mod W iff W is prime.