OFFSET
1,2
COMMENTS
Conjecture: a(n) > 0 for all n > 4. In other words, for any prime p > 7, there exists a prime q < p such that both q and q! are primitive roots modulo p.
P. Erdős asked whether for any sufficiently large prime p there exists a prime q < p which is a primitive root modulo p (see page 377 of Guy's book in the reference).
REFERENCES
R. K. Guy, Unsolved Problems in Number Theory, 3rd Edition, Springer, New York, 2004.
LINKS
Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
EXAMPLE
a(7) = 3 since both 3 and 3! = 6 are primititive roots modulo prime(7) = 17, but 2 is not a primitive root modulo 17.
MATHEMATICA
f[k_]:=Prime[k]!
dv[n_]:=Divisors[n]
Do[Do[Do[If[Mod[Prime[k]^(Part[dv[Prime[n]-1], i]), Prime[n]]==1||Mod[f[k]^(Part[dv[Prime[n]-1], i]), Prime[n]]==1, 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, 80}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Apr 21 2014
STATUS
approved