Here is a hint. If is a primitive root, then all primitive roots of mod are where and .

So we approach this by the hint, let be a primitive root. Then the product of all primitive roots mod is . Now for every primitive root we see that is a primitive root also. Therefore, we canpairthe primitive roots with their inverses. We just need to be careful, we need to know that is not paired with itself. But if . Thus, if we get and if then we get . And so it is correct to write because is even for .

This one should be approached like the one above. But this one is tricker. Let us focus on an easier case first, say . Now is a primitive then is a primitive root too (prove this). And so the entire sum can beShow that the sum of all primitive roots modulo is congruent to modulo .pairedto cancel out mod . And so we are left with zero. Notice that if then divides and so . Now you need to consider other cases.