Let $n \geq 2$, $H \lneq (\mathbb{Z}/n\mathbb{Z})^\*$, $\zeta\_k$ a primitive $k$-th root of unity. Is it possible that $$\sum\_{h \in H} \zeta\_k^{h} \in \mathbb{Z}$$ for every $k$ dividing $n$ such that $n/k \leq |H|$?


I do not know the answer even if $k=n$. That is, can it be that $$\sum\_{h \in H} \zeta\_n^{h} \in \mathbb{Z}$$



Can a sum of roots of unity be an integer?
**Below is the original and accepted proof, but see the by a factor of $100$ simpler later proof in the OP's answer!**  

The answer is *yes* for the second question, with $n=8$, since $\zeta\_8+\zeta\_8^5=0$. 


The answer is *no* for the first question. Let $\gamma\_k=\sum\_{h \in H} \zeta\_k^{h}$ be the sum from the question, a so-called Gaussian period. For a positive integer $m$ let $\nu(m)=\epsilon\prod\_{p|m}p$ ($p$ primes), where $\epsilon=2$ or $1$ if $m$ is divisible by $8$ or not, respectively. Set $G=(\mathbb Z/n\mathbb Z)^\star$, where we identify $G$ also with $\text{Gal}(\mathbb Q(\zeta\_n)/\mathbb Q)$. For a divisor $m$ of $n$ and a subgroup $U$ of $G$ set $U\_m=\{u\in U\;|\;u\equiv 1\pmod{m}\}$. Note that $U\_m$ is a subgroup of $U$. Theorems 5 and $6$ in [this paper](http://dx.doi.org/10.1007/BF01174877) by Evans yield the following:



> 
> * If $\gamma\_k=0$, then $H\_{\nu(k)}$ contains an element which is not contained in $H\_k$.
> * If $0\ne\gamma\_k\in\mathbb Q$, then $H$ restricted to $\mathbb Q(\zeta\_k)$ is the full automorphism group. Hence $\lvert H/H\_k\rvert=\varphi(k)$.
> 
> 
> 


From now on set $r=\nu(n)$. Clearly, $G\_r$ has order $n/r$. As $H\_r$ is a subgroup of $G\_r$, we get that $\lvert H\_r\rvert$ divides $n/r$. So $r$ divides $n/\lvert H\_r\rvert$, hence $H\_{n/\lvert H\_r\rvert}\le H\_r$. Our proof is based on the fact that actually
\begin{equation}\tag{1}
H\_{n/\lvert H\_r\rvert}=H\_r.
\end{equation}
To see this, let $p^e$ be the highest power of a prime $p$ dividing $n$, and let $h\in H\_r$ have order $m$. As $h\equiv 1\pmod{p}$, the order of $h$ modulo $p^e$ is a power $p^f\mid m$. Suppose that $p\ne2$. As the group of units modulo $p^e$ is cyclic of order $p^{e-1}$, we see that $h$ is a $p^{e-f-1}$-th power modulo $p^e$, so $h\equiv1\pmod{p^{e-f}}$. Handling similarly the case $p=2$ and applying the Chinese remainder theorem yields $h\equiv1\pmod{n/m}$. The claim follows, as $m$ divides $\lvert H\_r\rvert$. 


In the proof that the answer is no for the first equation, we distinguish two cases:


1. $8$ does not divide $n$, or $8$ divides $n/\lvert H\_r\rvert$: Set $k=n/\lvert H\_r\rvert$. So $n/k\le\lvert H\rvert$, thus $\gamma\_k\in\mathbb Q$ by the assumption.  


Recall that $H\_k=H\_r$ by (1). Furthermore, either $8$ does not divide $n$, or $8$ divides $k$. Hence $r=\nu(k)$ and therefore
\begin{equation}
H\_k=H\_r=H\_{\nu(k)}.
\end{equation}
We see that the first alternative $\gamma\_k=0$ cannot hold.  


So the second alternative holds, that is, $\varphi(k)=\lvert H/H\_k\rvert=\lvert H/H\_r\rvert$. But $\lvert H/H\_r\rvert$ divides $\varphi(r)$, so $\varphi(k)$ divides $\varphi(r)$, and therefore $k=r$. So $\lvert H\_r\rvert=n/k=n/r=\lvert G\_r\rvert$. We obtain $\lvert H\rvert=\varphi(r)n/r=\varphi(n)$, a contradiction.

- $8$ divides $n$, but $8$ does not divide $n/\lvert H\_r\rvert$: Again set $k=n/\lvert H\_r\rvert$. Then $r=2\nu(k)$. As above
\begin{equation}
H\_k=H\_r=H\_{2\nu(k)},
\end{equation}
and we finish as above provided that $H\_k=H\_{\nu(k)}$.  


So from now on we assume that $H\_{2\nu(k)}\ne H\_{\nu(k)}$. As $[H\_{\nu(k)}:H\_{2\nu(k)}]\le2$ we obtain
\begin{equation}
[H\_{\nu(k)}:H\_k]=2.
\end{equation}
We now show that $k'=k/2$ will work. Note that $4\mid r\mid k$, so $k'$ is even and still divides $n$. Furthermore, $n/k'=\lvert H\_r\rvert/2=\lvert H\_{\nu(k)}\rvert\le\lvert H\rvert$, so $\gamma\_{k'}\in\mathbb Q$ by the assumption.

As $k'$ is even, and $8\not\mid k$, we have $\nu(k)=\nu(k')$. Also, $\nu(k)$ divides $k/2=k'$. So
\begin{equation}
H\_k \le H\_{k'} \le H\_{\nu(k)}=H\_{\nu(k')}.
\end{equation}
But $2$ divides $k'$, while $4$ does not, so each element from $H\_{\nu(k)}$ is contained in $H\_{k'}$, hence $H\_{k'}=H\_{\nu(k')}$ and therefore the first alternative $\gamma\_{k'}=0$ does not hold.  


Thus $\lvert H/H\_{k'}\rvert=\varphi(k')$. Recall that $[H\_{k'}:H\_r]=2$. As in the first case, we obtain
\begin{equation}
\lvert H/H\_r\rvert=2\lvert H/H\_{k'}\rvert=2\varphi(k')=\varphi(k),
\end{equation}
so $\varphi(k)$ divides $\varphi(r)$, and as above we obtain the contradiction $\lvert H\rvert=\varphi(n)$.


