Is $\sqrt 7$ the sum of roots of unity?

Let $a_n$ and $b_n$ be 2 sequences of $n$ rationals.

Is it possible that $\sqrt 7 = \sum_{m=1}^{n} a_m (-1)^{b_m}$ ? Is it possible that $\sqrt{17}$ = $\sum_{m=1}^{n} a_m (-1)^{b_m}$ ?

How to prove or disprove these ?


Let $\zeta=e^{2\pi i/7}$. We know that the sum $$ 1+\zeta+\zeta^2+\cdots+\zeta^6=0. $$ Let $$ S=\zeta+\zeta^2+\zeta^4. $$ Then by squaring we get $$ S^2=\zeta^2+\zeta^4+\zeta^8+2\zeta^3+2\zeta^5+2\zeta^6. $$ Observe that $\zeta^8=\zeta$. Subtract the above equation multiplied by two from this to get $$ S^2=-2-\zeta-\zeta^2-\zeta^4=-2-S. $$ Let $M=2S+1$. Then $$ M^2=4S^2+4S+1=4(-2-S)+4S+1=-7. $$ Therefore $M=\pm i\sqrt7$, and you can surely construct a sum of the required type from this.

The above recipe works for all primes $p$ instead of $p=7$ as long as you follow the rule that the exponents of $\zeta$ (here $1,2,4$) are the quadratic residues modulo $p$ (so you need $(p-1)/2$ terms in the sum $S$). Whether you get $+p$ or $-p$ as the square depends on the residue class of $p$ modulo $4$.

Look up Gauss' sums for details of the general case.


Let $d$ be an integer. The field extension $\mathbb{Q}(\sqrt{d}) / \mathbb{Q}$ is a abelian extension, and therefore it is a subextension of a cyclotomic field extension $\mathbb{Q}(\zeta) / \mathbb{Q}$ where $\zeta$ is some root of unity. Thus, $\sqrt{d} \in \mathbb{Q}(\zeta)$ -- that is, $\sqrt{d}$ is a rational function of $\zeta$.

Since $\mathbb{Q}(\zeta)/\mathbb{Q}$ is an algebraic extension, this further means that $\sqrt{d}$ is a polynomial in $\zeta$ with rational coefficients, which is easy to put into the form you seek.

In fact, because $\sqrt{d}$ is an algebraic integer, it must lie in $\mathbb{Z}[\zeta]$, we can even select the $a_m$ to be integers. In fact, we can even arrange to have all of the $a_m$ be equal to 1, if we allow roots of unity to be repeated in the sum.


The square root of any number $n$, can be derived from the span of chords of a polygon $2n$, and $n$ if $4|n-1$. Correspondingly, since the cords can be derived from cyclotomic roots of $1$ (ie numbers of the form $cis(\pi m/n)$ where $0<m<2n$, then all such square roots can be so derived.

One approach to solving this sort of equation, is to look for a primitive root. For $13$, we might note that $2$ is a primitive root. We then create a power-series of $2$, modulo $13$. This gives a series of 12 numbers. We alternate these into two alternate series, eg

$$c(n) = cis(2\pi n/13)$$ $$S1 = c(1)+c(4)+c(3)+c(12)+c(9)+c(10)$$ $$S2 = c(2)+c(8)+c(6)+c(11)+c(5)+c(7)$$

One can see that the subscript in $S2$ is twice that of $S1$, and the subscript of the following term in $S1$ is four times that of the base term. So $3=4*4 mod 13$, etc.

Now, the isomorphism between $S1$ and $S2$ corresponds to a reversal of sign on a square-root. There is a therom that the product of numbers $1-c(n)$ for $n$ = 1 to p-1, gives p (here $p=13$), so the square root here is that $13 = (6-S1)*(6-S2)$. This works for all primes.

It should be noted that $6-S1$ is not exactly $\sqrt{13}$, but something that involves this prime, like $(13+3 \sqrt{13})/2$ or similar.