# How to solve $1+\frac12-\frac13+\frac14-\frac15-\frac16+\frac18+\ldots+\left(\frac n7\right)\frac1n+\ldots$?

$$1+\frac12-\frac13+\frac14-\frac15-\frac16+\frac18+\ldots+\left(\frac n7\right)\frac1n+\ldots$$ where $\left(\frac n7\right)$ is Legendre symbol. I think its about algebraic number theory, but I can't find relative problem on book.

If the signs were all +, the series would diverge as a harmonic sum. If the signs would alternate, it is well known that the sum of the series would be $\ln 2$. Here the signs follow a periodically repeating pattern of length seven: $$++-+--0,$$ where the $0$ at end indicates that terms $1/n$ with $n$ divisible by seven are missing altogether.

• Using $(n/7)$ to denote the Legendre symbol $\left(\frac n7\right)$ was a particularly bad idea. – Did Dec 29 '16 at 9:17
• 卓永鴻 Sorry about editing your question. I did it because the question was put on hold as unclear. I think that the users who voted that way didn't understand the use of Legendre symbol, and thought that may be you meant one of the series they had seen in calculus courses (or may be they just didn't understand). I tried to make that part clearer. I actually expect the question to get reopened soon. I could do that with my diamond moderator power vote, but that would look bad given that I have posted an answer (when it would be seen as me blowing my own trumpet), so I will not. – Jyrki Lahtonen Dec 29 '16 at 10:50
• Anyway, welcome to Math.SE! This is IMHO an ok question. Do familiarize yourself with the site culture. That will save you from mishaps like this in the future. The site is a wonderful resource, but to fully enjoy it you need to learn the ropes. That won't take too long. – Jyrki Lahtonen Dec 29 '16 at 10:55
• See also this related thread where the signs follow a periodically repeating pattern of length four. – Jyrki Lahtonen Dec 29 '16 at 11:05

Let $\zeta$ be some complex seventh root of unity, i.e. $\zeta=\zeta_\ell:=e^{2\pi \ell i/7}$, $\ell=0,1,2,\ldots,6$. The series $$S(\zeta)=\sum_{n=1}^\infty \frac{\zeta^n}n$$ converges to $-\log(1-\zeta)$ unless $\zeta=1$ when it diverges.
The way to use this is to write the Legendre symbol $\eta:n\mapsto\left(\frac n7\right)$ as a linear combination of the characters $\chi_\ell: n\mapsto\zeta_\ell^n$ with $\ell$ varying. The reason why this works is that $\eta$ as well as all the characters $\chi_\ell$ are actually well-defined functions from $G=\Bbb{Z}/7\Bbb{Z}$ to the complex numbers. Furthermore, the characters $\chi_\ell$, are linearly independent, and thus form a basis of the space of functions $G\to\Bbb{C}$. Therefore we can always find coefficients $c_\ell\in\Bbb{C}, \ell=0,1,2,\ldots,6,$ such that $$\eta(n)=\sum_{\ell=0}^6c_\ell\chi_\ell(n)$$ for all $n\in\Bbb{Z}_{>0}$. The tool for finding the coefficients $c_\ell$ is the Discrete Fourier Transform of $G$. Thankfully the coefficient $c_0$ corresponding to $S(1)$ vanishes. Otherwise the coefficients seem to be closely related to Gauss' sums, but those can easily be calculated explicitly in such a small case. Leaving that to you (do ask for hints, if you cannot figure it out).
Your sum is then the corresponding linear combination of the $S(\zeta)$s: $$\sum_{n=1}^\infty\frac{\eta(n)}n=\sum_{\ell=1}^6c_\ell S(\zeta_\ell).$$
• And for those of us with a more numerical side, the result is $$\int_0^1\frac{1+2t+t^2+2t^3+t^4}{1+t+t^2+t^3+t^4+t^5+t^6}dt\approx1.18741$$ – Did Dec 29 '16 at 10:56
• This requires to compute the series $$A(t)=\sum_{n=1}^\infty\left(\frac{n}7\right)t^{n-1}=\sum_{k=0}^{\infty}t^{7k}(1+t-t^2+t^3-t^4-t^5)$$ which is $$A(t)=\frac{1+t-t^2+t^3-t^4-t^5}{1-t^7}=\frac{1+2t+t^2+2t^3+t^4}{1+t+t^2+t^3+t^4+t^5+t^6}$$ and to note that $$\sum_{n=1}^\infty\left(\frac{n}7\right)\frac1n=\int_0^1A(t)dt$$ – Did Jan 3 '17 at 8:58