Let $q(n)$ denote the primitive $n$th roots of unity and let $K=\mathbb{Q}(q(n))$ be the associated cyclotomic field. Let $a$ denote the trace of $q(n)$ from $K$ to $\mathbb{Q}.$
How to
prove that $a=1$ if $n=1$, $a=0$ if $n$ is divisible by the square of a prime, and $a=(-1)^r$ if $n$ is the product of $r$ distinct primes?