OFFSET
1,5
COMMENTS
Conjecture: a(n) > 0 for all n > 11. In other words, for any prime p > 31 there are a,b,c among 1,...,p-1 with a^2 + b^2 = c^2 such that a*b*c is a primitive root modulo p.
LINKS
Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
EXAMPLE
a(5) = 10 since 10^2 = 6^2 + 8^2, and 6*8*10 = 480 is a primitive root modulo prime(5) = 11.
MATHEMATICA
SQ[n_]:=IntegerQ[Sqrt[n]]
Dv[n_]:=Divisors[Prime[n]-1]
Do[Do[If[SQ[k^2-j^2]==False, Goto[aa]]; Do[If[Mod[(Sqrt[k^2-j^2]j*k)^(Part[Dv[n], t]), Prime[n]]==1, Goto[aa]]; Continue, {t, 1, Length[Dv[n]]-1}]; Print[n, " ", k]; Goto[bb]; Label[aa]; Continue, {k, 1, Prime[n]-1}, {j, 1, k-1}]; Print[n, " ", 0]; Label[bb]; Continue, {n, 1, 70}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Aug 05 2015
STATUS
approved