OFFSET
1,3
COMMENTS
According to the conjecture in A242210, 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(7) = 3 since 3 is a primitive root modulo prime(7) = 17 but 2 is not.
MATHEMATICA
rMod[m_, n_]:=Mod[Numerator[m]*PowerMod[Denominator[m], -1, n], n, -n/2]
f[k_]:=BernoulliB[Prime[k]-1]
dv[n_]:=Divisors[n]
Do[Do[If[rMod[f[k], Prime[n]]==0, Goto[aa]]; 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, " ", Prime[k]]; Goto[bb]; Label[aa]; Continue, {k, 1, n-1}]; Print[n, " ", 0]; Label[bb]; Continue, {n, 1, 70}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, May 07 2014
STATUS
approved