# A sum involving roots of unity

Let $$n$$ be a positive integer and $$\zeta$$ be a primitive $$n$$th root of unity. It is not hard to show that \begin{align*} \sum_{k=1}^{n-1}\frac{\zeta^k}{1-\zeta^k}=\frac{1-n}{2}. \end{align*} Since $$\zeta^n=1$$, we have \begin{align*} \frac{\zeta^k}{1-\zeta^k}+\frac{\zeta^{n-k}}{1-\zeta^{n-k}} =\frac{\zeta^k}{1-\zeta^k}+\frac{\zeta^{-k}}{1-\zeta^{-k}} =-1, \end{align*} and so \begin{align*} \sum_{k=1}^{n-1}\frac{\zeta^k}{1-\zeta^k}=\frac{1}{2} \sum_{k=1}^{n-1}\left(\frac{\zeta^k}{1-\zeta^k}+\frac{\zeta^{-k}}{1-\zeta^{-k}}\right) =\frac{1-n}{2}. \end{align*} Let $$\omega$$ be a primitive $$(3n+2)$$th root of unity. By the same method, we can also get \begin{align*} \sum_{k=0}^{2n+1}(-1)^k\omega^{\frac{k(3k+1)}{2}}= \sum_{k=0}^{n}\left((-1)^k\omega^{\frac{k(3k+1)}{2}}+(-1)^{2n+1-k} \omega^{\frac{(2n+1-k)(3(2n+1-k)+1)}{2}}\right)=0, \end{align*} because \begin{align*} \omega^{\frac{(2n+1-k)(3(2n+1-k)+1)}{2}}=\omega^{\frac{k(3k+1)}{2}+(3n+2)(2n-2k+1)}= \omega^{\frac{k(3k+1)}{2}}. \end{align*} Note that the above two sums possess natural symmetries.

Question. Let $$\omega=e^\frac{2\pi i}{3n+2}$$ be the primitive $$(3n+2)$$th root of unity. Numerical calculation suggests that \begin{align*} \sum_{k=1}^{2n+1}\frac{(-1)^k\omega^{\frac{k(3k+1)}{2}}}{1-\omega^{3k}}=-\frac{n+1}{2}. \end{align*} Is this identity true? If so, how to prove it? Unfortunately, this sum loses a natural symmetry. Hints, references or proofs are all welcome!

Comments: Nemo proved that for arbitrary $$w$$, \begin{align*} \sum _{k=1}^{2 n+1} \frac{(-1)^k w^{k (3 k+1)/2}}{1-w^{3 k}}&=-\sum _{k=0}^{2 n} \frac{(-1)^k w^{\frac{1}{2} (k+2) (3 k+1)}}{1-w^{3 k+1}}\\ &+\frac{1}{2} \sum _{k=0}^{2 n} \left(\frac{(-1)^k w^{(3 k+1) (n+1)}}{1-w^{(3k+1)/2}}+\frac{w^{(3 k+1) (n+1)}}{w^{(3k+1)/2}+1}\right)\\ &+\frac{1}{2} \sum _{k=1}^{2 n+1} \left(\frac{(-1)^k w^{k/2}}{1-w^{3k/2}}+\frac{w^{k/2}}{w^{3k/2}+1}\right). \end{align*} This identity has been reproved by GH from MO below.

Letting $$k\to 2n+1-k$$ in the following sum gives \begin{align*} \sum _{k=0}^{2 n} \frac{(-1)^k w^{\frac{1}{2} (k+2) (3 k+1)}}{1-w^{3 k+1}} =\sum _{k=1}^{2 n+1} \frac{(-1)^k w^{k (3 k+1)/2}}{1-w^{3 k}}, \end{align*} where we have used the fact $$w^{3n+2}=1$$. Also, we have (letting $$k\to 2n+1-k$$) \begin{align*} \sum _{k=0}^{2 n} \left(\frac{(-1)^k w^{(3 k+1) (n+1)}}{1-w^{(3k+1)/2}}+\frac{w^{(3 k+1) (n+1)}}{w^{(3k+1)/2}+1}\right)= \sum _{k=1}^{2 n+1} \left(\frac{(-1)^k w^{k/2}}{1-w^{3k/2}}+\frac{w^{k/2}}{w^{3k/2}+1}\right). \end{align*} So it suffices to show that \begin{align*} \sum _{k=1}^{2 n+1} \left(\frac{(-1)^k w^{k/2}}{1-w^{3k/2}}+\frac{w^{k/2}}{w^{3k/2}+1}\right)=-n-1, \end{align*} which was proved by Fedor Petrov.

• Can you prove at least that your sum is rational? If so, you can average it over all primitive roots of unity of degree 3n+2. – Seva Feb 4 at 18:19
• It looks like a "q-version" (whatever this means) of the known congruence $1-1/2+1/3-1/4+\dots+1/(2n+1)\equiv 0 \pmod {3n+2}$ provided that $3n+2$ is prime. (For $n=659$ this was proposed on IMO in year $3n+2=1979$.) The standard solution is $S=(1+1/2+\dots+1/(2n+1))-2(1/2+\dots+1/(2n))=1/(n+1)+\dots+1/(2n+1)$ and now the symmetry $1/x+1/(3n+2-x)\equiv 0 \pmod {3n+2}$. I do not see how to modify it. – Fedor Petrov Feb 5 at 5:38
• I proved $$\sum _{k=1}^{2 n+1} \frac{(-1)^k w^{k (3 k+1)/2}}{1-w^{3 k}}=-\sum _{k=0}^{2 n} \frac{(-1)^k w^{\frac{1}{2} (k+2) (3 k+1)}}{1-w^{3 k+1}}+\\\frac{1}{2} \sum _{k=0}^{2 n} \frac{(-1)^k w^{(3 k+1) (n+1)}}{1-w^{(3k+1)/2}}+\frac{1}{2} \sum _{k=0}^{2 n} \frac{w^{(3 k+1) (n+1)}}{w^{(3k+1)/2}+1}+\frac{1}{2} \sum _{k=1}^{2 n+1} \left(\frac{(-1)^k w^{k/2}}{1-w^{3k/2}}+\frac{w^{k/2}}{w^{3k/2}+1}\right)$$ for arbitrary $w$. – Nemo Feb 5 at 8:22
• Now if one specifies w as the primitive (3n+2)th root of unity then the first sum on the rhs due to the symmetry $k\to 2n+1-k$ equals the sum under consideration $$\sum _{k=1}^{2 n+1} \frac{(-1)^k w^{k (3 k+1)/2}}{1-w^{3 k}}=\sum _{k=0}^{2 n} \frac{(-1)^k w^{\frac{1}{2} (k+2) (3 k+1)}}{1-w^{3 k+1}}$$ thus allows to solve for this sum in terms of 4 simpler sums. I believe this 4 simple sums can be calculated using the symmetry $k\to 2n+1-k$. – Nemo Feb 5 at 8:37
• Based on the comments from @Nemo, it suffices to show that $$\sum_{k=1}^{2n+1}\left(\frac{(-y)^k}{1-y^{3k}}+ \frac{y^{k}}{1+y^{3k}}\right)=-n-1,$$ where $y=e^{\frac{2\pi i}{6n+4}}$ is the primitive $(6n+4)$th root of unity. – Ji-Cai Liu Feb 5 at 13:25

Here is the proof of Kevin Liu's version $$\sum_{k=1}^{2n+1}\left(\frac{(-y)^k}{1-y^{3k}}+ \frac{y^{k}}{1+y^{3k}}\right)=-n-1$$ (for the primitive root of unity $$y$$ of degree $$6n+4$$) of Nemo's reduction. (Both reductions deserve to be explained, in my opinion.)

We have $$\sum_{k=1}^{2n+1} \frac{(-y)^k}{1-y^{3k}}= -\sum_{k=1}^{2n+1} \frac{y^{k}}{1-y^{3k}}+2\sum_{k=1}^n\frac{y^{2k}}{1-y^{6k}}.$$

So we should prove

$$2\sum_{k=1}^{2n+1} \frac{y^{4k}}{1-y^{6k}}-2\sum_{k=1}^n \frac{y^{2k}}{1-y^{6k}}=n+1$$

Denote again $$w=y^2$$, the primitive root of unity of degree $$3n+2$$, this reads as

$$2\sum_{k=1}^{2n+1}\frac{w^{2k}}{1-w^{3k}}-2\sum_{k=1}^n\frac{w^k}{1-w^{3k}}=n+1$$

Partition LHS onto two identical halfs (it has multiple 2 for that), and in one of them make the change of variables $$k\mapsto 3n+2-k$$. This half reads as $$\sum_{k=n+1}^{3n+1}\frac{w^{-2k}}{1-w^{-3k}}-\sum_{k={2n+2}}^{3n+1}\frac{w^{-k}}{1-w^{-3k}}= -\sum_{k=n+1}^{3n+1}\frac{w^{k}}{1-w^{3k}}+\sum_{k={2n+2}}^{3n+1}\frac{w^{2k}}{1-w^{3k}}.$$ Collecting with another half we get (so lucky) $$\sum_{k=1}^{3n+1} \frac{w^{2k}-w^k}{1-w^{3k}}=-\sum_{k=1}^{3n+1} w^k\frac{1-w^{3k(n+1)}}{1-w^{3k}}= -\sum_{k=1}^{3n+1} (w^k+w^{4k}+w^{7k}+\dots+w^{(3n+1)k})=n+1,$$ since the numbers $$1,4,\dots,3n+1$$ are not divisible by $$3n+2$$ and $$\sum_{k=0}^{3n+1} w^{kd}=0$$ for all integers $$d$$ non-divisible by $$3n+2$$.

Here is a proof of Nemo's identity. Using the notation $$y:=w^{1/2}$$, multiplying both sides by $$2$$, and shifting $$k$$ by $$1$$ in three of the five sums, the identity can be rewritten as $$\sum_{k=1}^{2n+1}f_{k,n}(y)=0,$$ where \begin{align*}f_{k,n}(y):=&\frac{(-1)^ky^k}{1-y^{3k}}+\frac{y^k}{1+y^{3k}}-2\frac{(-1)^ky^{k(3k+1)}}{1-y^{6k}}\\[6pt] &+2\frac{(-1)^ky^{(k+1)(3k-2)}}{1-y^{6k-4}}-\frac{(-1)^ky^{(2n+2)(3k-2)}}{1-y^{3k-2}} +\frac{y^{(2n+2)(3k-2)}}{1+y^{3k-2}}\\[6pt] =&(-1)^ky^k\frac{1-y^{3k^2}}{1-y^{3k}}+y^k\frac{1-(-1)^ky^{3k^2}}{1+y^{3k}}\\[6pt] &+(-1)^ky^{(k+1)(3k-2)}\frac{1-y^{(2n-k+1)(3k-2)}}{1-y^{3k-2}} +(-1)^ky^{(k+1)(3k-2)}\frac{1+(-1)^ky^{(2n-k+1)(3k-2)}}{1+y^{3k-2}}\\[6pt] =&\sum_{m=0}^{k-1}\left((-1)^k+(-1)^m\right)y^{k(3m+1)}+ \sum_{m=0}^{2n-k}\left((-1)^k+(-1)^{k+m}\right)y^{(k+m+1)(3k-2)}. \end{align*} In the first $$m$$-sum, the term $$m=k-1$$ does not contribute, hence what we really need to prove is $$\sum_{k=1}^{2n+1}\sum_{m=0}^{k-2}\left((-1)^k+(-1)^m\right)y^{k(3m+1)}+ \sum_{k=1}^{2n+1}\sum_{m=0}^{2n-k}\left((-1)^k+(-1)^{k+m}\right)y^{(k+m+1)(3k-2)} =0.$$ In the second double sum, we make the change of variables $$k':=k+m+1$$ and $$m':=k-1$$. With this notation, the previous equation becomes $$\sum_{k=1}^{2n+1}\sum_{m=0}^{k-2}\left((-1)^k+(-1)^m\right)y^{k(3m+1)}+ \sum_{k'=1}^{2n+1}\sum_{m'=0}^{k'-2}\left((-1)^{m'+1}+(-1)^{k'-1}\right)y^{k'(3m'+1)} =0.$$ The two double sums now clearly neutralize each other termwise, and the proof is complete.