OFFSET
1,3
COMMENTS
Conjecture: a(n) > 0 except for n = 2. In other words, for any prime p > 3, there exists a primitive root 0 < g < p modulo p such that 2^g - 1 is also a primitive root modulo p.
LINKS
Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
Zhi-Wei Sun, Notes on primitive roots modulo primes, arXiv:1405.0290 [math.NT], 2014.
EXAMPLE
a(4) = 5 since both 5 and 2^5 - 1 = 31 are primitive roots modulo prime(4) = 7, but none of 1, 2, 4 and 2^3 - 1 is a primitive root modulo prime(4) = 7.
MATHEMATICA
f[n_]:=f[n]=2^n-1
dv[n_]:=Divisors[n]
Do[Do[If[Mod[f[k], Prime[n]]==0, Goto[aa]]; Do[If[Mod[k^(Part[dv[Prime[n]-1], j])-1, Prime[n]]==0, Goto[aa]], {j, 1, Length[dv[Prime[n]-1]]-1}]; Do[If[rMod[f[k]^(Part[dv[Prime[n]-1], i])-1, Prime[n]]==0, Goto[aa]], {i, 1, Length[dv[Prime[n]-1]]-1}];
Print[n, " ", k]; Goto[bb]; Label[aa]; Continue, {k, 1, Prime[n]-1}]; Label[cc]; Print[n, " ", 0]; Label[bb]; Continue, {n, 1, 70}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, May 09 2014
STATUS
approved