OFFSET
1,3
COMMENTS
According to the conjecture in A242248, a(n) should be positive for all n > 2.
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(5) = 8 since 8, 2^8 - 1 = 255 and (8-1)! = 5040 are all primitive roots modulo prime(5) = 11 with 255 == 5040 == 2 (mod 11), but none of 1, 2^2 - 1, 3, 4, 5, (6-1)! and (7-1)!
is a primitive root modulo 11.
MATHEMATICA
f[n_]:=f[n]=2^n-1
g[n_]:=g[n]=(n-1)!
rMod[m_, n_]:=rMod[m, n]=Mod[m, n, -n/2]
dv[n_]:=dv[n]=Divisors[n]
Do[Do[If[Mod[f[k], Prime[n]]==0, Goto[aa]]; Do[If[Mod[k^(Part[dv[Prime[n]-1], i])-1, Prime[n]]==0||Mod[rMod[f[k], Prime[n]]^(Part[dv[Prime[n]-1], i])-1, Prime[n]]==0||Mod[rMod[g[k], Prime[n]]^(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}]; Print[n, " ", 0]; Label[bb]; Continue, {n, 1, 70}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, May 09 2014
STATUS
approved