Suppose that $p$ is a prime. Prove that the sum of the primitive roots modulo $p$ is congruent to $\mu(p − 1) \pmod{p}$.

14Please don't post questions in the imperative mode; this may be homework for you, but you aren't assigning it as homework to *us*. You are asking a question, so kindly phrase it like a question. Also, given that this is homework, it would be nice (and polite, and helpful) if you say what you have tried, and where you are stuck. That way the answers can deal directly with whatever it is you are having trouble with. – Arturo Magidin Mar 07 '11 at 05:40

4Hint: If $latex f = x^n + f_{n1} x^{n1} + \cdots + f_0$ is a polynomial whose roots are $r_1$, ..., $r_n$, then $ \sum r_i = f_{n1}$. – David E Speyer Mar 07 '11 at 16:31

I've seen this result in a few books. But I can't see why it is interesting. Can someone please enlighten me? – lhf Jan 12 '12 at 13:13

Related: http://math.stackexchange.com/questions/737892 – Bart Michels Mar 14 '15 at 11:37
4 Answers
If $g$ is a primitive root of $p$ then Thm 10.9 of Apostol says the sum in question, $S$, is given by
$$S=\!\!\!\!\!\sum_{\substack{k=1\\(k,p1)=1}}^{p1}\!\!\!\!\!\!g^k=\sum_{k=1}^{p1}g^k\sum_{\substack{dk\\dp1}}\mu(d)=\sum_{dp1}\mu(d)\sum_{r=1}^{(p1)/d}\!\!g^{rd}$$
The inner sum is congruent to $0$ unless $d=p1$ when it is congruent to $1$.
 24,846
 5
 45
 108
 484
 3
 9

For more than one condition under the $\sum$ sign, you can use `\sum_{\substack{xx\\ yy}}`. – Bart Michels Mar 14 '15 at 11:31
If $p  1 = a^\alpha b^\beta c^\gamma ...$. Then if $A$ is an element of order $a^\alpha$, $B$ is an element of order $b^\beta$, etc. then ABC... is a primitive root.
If A, A', A'', etc. are the elements of order $a^\alpha$, B, B', B'', etc. are the elements of order $b^\beta$, then
(A + A' + ...) (B + B' + ...) (C + C' + ...) ... is the sum of the primitive roots.
Now consider the sum of the terms in any one of the factors, keeping in mind the fact that if $k$ is the order of $y$ and $l$ is relatively prime to $k$, then $y^l$ also has order $k$.
 83
 1
 6

2I am glad to see this answer here; it reminds me of some forgotten facts... May I ask you a question? Is this answer out of the book *Disquisitions Arithmeticae* by **Gauß**? I see some hints and footprints here. Thanks for sharing. – awllower Feb 08 '12 at 09:12
Let $f(d)$ sum the elements $u$ of order $d$, and let $g(d)$ sum the elements $u$ whose $d$th powers are $1$. Thus $g$ can be evaluated as a geometric sum, and also it has an expression in terms of $f$ that sets up Möbius inversion to give $f$ in terms of $g$; the exercise is requesting $f(p − 1)$, so we are done. (This answer essentially repeats the others, but maybe invoking the Möbius inversion rather than redoing it in the middle of other things is tidy.)
 31
 2
The appearance of the Möbius function is a hint that Möbius inversion is involved.
To get it out of the way, the special case $p=2$ is trivial as $1$ is the only primitive root and equals $\mu(21)$.
Now, assume $p$ is an odd prime, for which there must a primitive root $g$.
Like the other answers, define $f(n)$ as the sum of elements or order $n$ (in the multiplicative group mod $p$). Since primitive roots have order $p1$, our answer is $f(p1)$.
As an aside, the elements of order $n$ are exactly the $g^k$ where $(p1)/\gcd(k, p1) = n$, so for $n \mid p1$, $$ f(n) = \sum_{\gcd(k,p1) = (p1)/n} g^k $$
Also by Lagrange's theorem, $f(n) = 0$ if $n \nmid p1$.
Now define the summatory function $F(n) = \sum_{d \mid n} f(d)$, the sum of the elements of order dividing $n$. By the Möbius inversion formula, $$ f(p1) = \sum_{d \mid p1} \mu(d) F\left(\frac{p1}{d} \right) $$
For all $d \mid p1$, the elements with order dividing $(p1)/d$ are powers of $g^d$, as $g^x$ has order $(p1)/\gcd(p1, x)$ which divides $(p1)/d$ iff $d \mid \gcd(p1,x)$, satisfied iff $x = kd$ for $1 \le k \le (p1)/d$.
Then for $d= p1$, $F((p1)/d) = 1$, and for $d < p1$, $$ F\left(\frac{p1}{d} \right) = \sum_{k=1}^{(p1)/d} g^{kd} = g^d \left(\frac{g^{p1}1}{g^d1} \right) \equiv 0 \mod p $$
The geometric series term is valid since $d < p1$ so $g^d 1 \not \equiv 0 \mod p$, while $g^{p1}  1 \equiv 0 \mod p$.
We conclude $f(p1) \equiv \mu(p1) \mod p$.
 9,834
 4
 38
 70