OFFSET
1,3
COMMENTS
In Article 81 of his Disquisitiones Arithmeticae (1801), Gauss proves that the sum of all primitive roots (A001918) of a prime p, mod p, equals MoebiusMu[p-1] (A008683). "The sum of all primitive roots is either = 0 (mod p) (when p-1 is divisible by a square), or = +-1 (mod p) (when p-1 is the product of unequal prime numbers; if the number of these is even the sign is positive but if the number is odd, the sign is negative)."
REFERENCES
J. C. F. Gauss, Disquisitiones Arithmeticae, 1801.
LINKS
T. D. Noe, Table of n, a(n) for n = 1..10000
Eric Weisstein, Primitive Roots.
EXAMPLE
The primitive roots of 13 are 2, 6, 7, 11. Their sum is 26, or 0 (mod 13). By Gauss, 13-1=12 is thus divisible by a square number.
MATHEMATICA
primitiveRoots[n_] := If[n == 1, {}, If[n == 2, {1}, Select[Range[2, n-1], MultiplicativeOrder[#, n] == EulerPhi[n] &]]]; Table[Total[primitiveRoots[n]], {n, 100}]
(* From version 10 up: *)
Table[Total @ PrimitiveRootList[n], {n, 1, 100}] (* Jean-François Alcover, Oct 31 2016 *)
CROSSREFS
KEYWORD
nice,nonn,changed
AUTHOR
Ed Pegg Jr, Jul 25 2006
STATUS
approved