Show that if n has primitive roots then Let $$P_{n}=\prod_{1\le a\le n ,(a,n)=1}a $$ Show that if n has primitive roots then $P_{n}=-1$(mod n).Otherwise $P_{n}=1$(mod n).
How do I approach this one? It seems interesting.
 A: Note that there are two kinds of elements in your product: elements $x$ satisfying $x^2 = 1$ and elements satisfying $xy = 1$ for some $y \ne x$.  The elements of the second kind can be paired together, with the product of each pair equal to 1.  Therefore, the overall product is equal to the product of all of the elements squaring to $1$.
If $(\mathbb{Z}/n\mathbb{Z})^\times$ is cyclic, there can be only one such element, and it furthermore must be $-1$.
Otherwise,  you need to show that the set of such elements forms an elementary abelian 2-subgroup of rank at least 2.  It's clear that the product of every element in such a group is the identity, by taking a basis $x_1, \ldots x_n$, and then taking the product of the elements $x_1^{i_1}\dots x_n^{i_n}$ over all choices $(i_j) \in \{0,1\}^n$ yields the answer $x_1^{2^{n-1}}\dots x_n^{2^{n-1}} = 1$.
Off the top of my head, showing that this is the case uses the fact that the groups $(\mathbb{Z}/n\mathbb{Z})^\times$ are not cyclic precisely when $n$ has two distinct odd prime divisors or when $n$ is divisible by both $4$ and an odd prime.  Therefore, my approach doesn't help if you're trying to use this fact to classify when $(\mathbb{Z}/n\mathbb{Z})^\times$ is cyclic.
