# What is the closed form for $\sum_{n=1}^\infty \frac1n - \frac1{n+1/p}$?

A while ago, I started to look at expressions of the following form: $$S_p:=\sum_{n=1}^\infty \frac1n - \frac1{n+1/p},$$ where $p$ is prime, because otherwise things get too complicated for me at the moment. What I found so far is the following: $$S_p= p -\log(2p) - \frac12 \pi \cot\left(\frac\pi p\right) + T_p,$$ where $T_p$ contains $\frac{p-1}2$ terms $t_{p,k}$ of the form: \begin{cases} \pm 2 \sin\left(\frac{k\pi}{2p}\right) \log\left(\sin\left(\frac{k\pi}{2p}\right)\right) \\ \pm 2 \cos\left(\frac{k\pi}{2p}\right) \log\left(\sin\left(\frac{k\pi}{2p}\right)\right)\\ \pm 2 \sin\left(\frac{k\pi}{2p}\right) \log\left(\cos\left(\frac{k\pi}{2p}\right)\right) \\ \pm 2 \cos\left(\frac{k\pi}{2p}\right) \log\left(\cos\left(\frac{k\pi}{2p}\right)\right) \end{cases}

An example can be found here.

How does the closed form for $\sum_{n=1}^\infty \frac1n - \frac1{a+n}$ look like? (EDIT: where $a=1/p$)

• Are you looking for this formula? $$\psi\left(\frac{m}{k}\right) = -\gamma - \log(2k) - \frac{\pi}{2}\cot\left(\frac{m\pi}{k}\right) + 2\sum_{n=1}^{\lfloor\frac{k-1}{2}\rfloor} \cos\left(\frac{2\pi nm}{k}\right)\log\left(\sin\left(\frac{n\pi}{k}\right)\right)$$ where $m$ and $k\;(m < k)$ are positive integers. (Note: I've no idea how to prove this) – achille hui Jul 12 '14 at 9:11
• @achillehui looks promising... – draks ... Jul 12 '14 at 10:04

First, for any $z \in \mathbb{C}$ with $|z| < 1$, we have following expansion

$$-\log(1-z) = \sum_{n=1}^\infty \frac{z^n}{n}$$

Let $\displaystyle\;\omega = e^{\frac{i2\pi}{p}}\;$ be the primitive $p$-root of unity, we know for any integer $n$,

$$\frac{1}{p}\sum_{\ell=0}^{p-1} (\omega^\ell)^n = \delta_p(n) \stackrel{def}{=} \begin{cases}1,& n \equiv 0\pmod p\\0,& \text{otherwise}\end{cases}$$ This implies for any integer $k \in \{\;1,2,\ldots,p\;\}$, we have

$$-\frac{1}{p}\sum_{\ell=0}^{p-1}\omega^{-k\ell}\log(1-z\omega^\ell) = \frac{1}{p}\sum_{\ell=0}^{p-1}\sum_{n=1}^\infty \frac{z^n}{n}( \omega^\ell )^{n-k} = \sum_{n=1}^\infty \delta_p(n-k)\frac{z^n}{n} = \frac{1}{p}\sum_{n=0}^\infty \frac{z^{np+k}}{n+\frac{k}{p}}$$

This leads to $$\sum_{n=0}^\infty\left(\frac{1}{n+1} - \frac{1}{n+\frac{k}{p}}\right)z^{np} = - \sum_{\ell=0}^{p-1}\left(z^{-p} - z^{-k}\omega^{-k\ell}\right)\log(1-z\omega^\ell) \tag{*1}$$ Since the sequences $\displaystyle\;\frac{1}{n+1} - \frac{1}{n+\frac{k}{p}} \sim O\left(\frac{1}{n^2}\right)\;$, the series on the LHS converges absolutely as $z \to 1^{-}$. The RHS is a finite sum, the only term that may cause trouble is the term for $\ell = 0$. It is clear the logarithm singularity from the $\log(1-z)$ get killed by the $z^{-p} - z^{-k}$ factor as $z \to 1^{-}$. This allow us to take the limit $z \to 1^{-}$ in $(*1)$ and get $$\mathcal{S}_{k/p} \stackrel{def}{=} \sum_{n=1}^\infty\left(\frac{1}{n} - \frac{1}{n+\frac{k}{p}}\right) = \frac{p}{k} + \sum_{n=0}^\infty\left(\frac{1}{n+1} - \frac{1}{n+\frac{k}{p}}\right)\\ = \frac{p}{k} - \sum_{\ell=1}^{p-1}\left(1 - \omega^{-kl}\right)\log(1-\omega^\ell)$$ Using the identities

$$\sum_{\ell=1}^{p-1}\log(1-\omega^\ell) = \log p \quad\text{ and }\quad \sum_{\ell=1}^{p-1}\omega^\ell = -1$$ The sum reduces to \begin{align} &\frac{p}{k} - \log(2p) + \sum_{l=1}^{p-1}\omega^{-k\ell}\log\left(\frac{1-\omega^\ell}{2}\right)\\ = & \frac{p}{k} - \log(2p) + \sum_{l=1}^{p-1} \left( \cos\left(\frac{2\pi k\ell}{p}\right) - i\sin\left(\frac{2\pi k\ell}{p}\right) \right)\left(\log\sin\left(\frac{\ell\pi}{p}\right) + i\pi\left(\frac{\ell}{p}-\frac12\right)\right) \end{align} Using another set of trigonometric identities $$\sum_{\ell=1}^{p-1}\frac{\ell}{p}\sin\left(\frac{2\pi k\ell}{p}\right) = -\frac12\cot\left(\frac{k\pi}{p}\right) \quad\text{ and }\quad \sum_{\ell=1}^{p-1}\sin\left(\frac{2\pi k\ell}{p}\right) = 0$$ We finally get $$\bbox[4pt,border:1px solid blue]{ \mathcal{S}_{k/p} = \frac{p}{k} - \log(2p) -\frac{\pi}{2}\cot\left(\frac{k\pi}{p}\right) + \sum_{l=1}^{p-1} \cos\left(\frac{2\pi k\ell}{p}\right) \log\sin\left(\frac{\ell\pi}{p}\right) } \tag{*2}$$

On the wiki page of digamma function, there is a formula for digamma function at $\frac{k}{p}$.

$$\psi\left(\frac{k}{p}\right) = -\gamma - \log(2p) - \frac{\pi}{2}\cot\left(\frac{k\pi}{p}\right) + 2\sum_{\ell=1}^{\lfloor\frac{p-1}{2}\rfloor} \cos\left(\frac{2\pi k\ell}{p}\right)\log\sin\left(\frac{\ell\pi}{p}\right)$$

Compare this with what we have in $(*2)$, we can simplify our sum as

$$\mathcal{S}_{k/p} = \frac{p}{k}+\psi\left(\frac{k}{p}\right) + \gamma = \psi\left(\frac{k}{p}+1\right) + \gamma$$

Replace $\frac{k}{p}$ by $a$, this matches the result derived in another answer.

• A creative application of series multisection. (+1) – Markus Scheuer Mar 12 at 5:56

$\newcommand{\+}{^{\dagger}} \newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle} \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack} \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,} \newcommand{\dd}{{\rm d}} \newcommand{\down}{\downarrow} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,{\rm e}^{#1}\,} \newcommand{\fermi}{\,{\rm f}} \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,} \newcommand{\half}{{1 \over 2}} \newcommand{\ic}{{\rm i}} \newcommand{\iff}{\Longleftrightarrow} \newcommand{\imp}{\Longrightarrow} \newcommand{\isdiv}{\,\left.\right\vert\,} \newcommand{\ket}[1]{\left\vert #1\right\rangle} \newcommand{\ol}[1]{\overline{#1}} \newcommand{\pars}[1]{\left(\, #1 \,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\pp}{{\cal P}} \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,} \newcommand{\sech}{\,{\rm sech}} \newcommand{\sgn}{\,{\rm sgn}} \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}} \newcommand{\ul}[1]{\underline{#1}} \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert} \newcommand{\wt}[1]{\widetilde{#1}}$ $\ds{\mbox{How does the closed form for}\ \sum_{n = 1}^{\infty}\pars{{1 \over n} - {1 \over a + n}}\ \mbox{look like ?}}$

\begin{align} \!\!\sum_{n = 1}^{\infty}\pars{{1 \over n}\! - \!{1 \over a + n}} &\!=a\sum_{n = 1}^{\infty}{1 \over n\pars{a + n}} \!=a\sum_{n = 0}^{\infty}{1 \over \pars{n + 1 + a}\pars{n + 1}} =\!a\,{\Psi\pars{1 + a} \!-\! \Psi\pars{1} \over \pars{1 + a} - 1} \end{align} where $\ds{\Psi\pars{z}}$ is the Digamma Function $\ds{\bf\mbox{6.3.1}}$ and we used identity $\ds{\bf\mbox{6.3.16}}$.

$$\color{#66f}{\large% \sum_{n = 1}^{\infty}\pars{{1 \over n} - {1 \over a + n}} =\Psi\pars{1 + a} + \gamma} = {\rm H}_{a}$$

$\ds{\gamma = -\Psi\pars{1}}$ is the Euler-Mascheroni Constant $\ds{\bf\mbox{6.1.3}}$. $\quad\ds{\gamma \approx 0.5772156649\ldots\quad}$ $\ds{{\rm H}_{a}}$ is a generalized Harmonic Number.

• Looks good, but not what I was looking for. Can express it that in the terms given in the question? – draks ... Jul 12 '14 at 5:44
• @draks... There isn't way to escape from the ${\large \bf{\tt\mbox{Harmonic Number}}}$. It's even suggested by the question. – Felix Marin Jul 12 '14 at 8:20
• So you say there is no rule to generate the $t_{p,k}$ terms, that show up in my example? Unbelievable... – draks ... Jul 12 '14 at 8:52
• @draks... I'll think about it. Now, it's too late. Tomorrow I can make some comment about. Thanks. – Felix Marin Jul 12 '14 at 9:08
• @draks... $\tt\color{#66f}{\mbox{@achille hui}}$ already pointed out the connection between my answer and your expected result. Thanks. – Felix Marin Jul 14 '14 at 20:21

Write your expression as the limit at $x \to 1$ of $$\sum_{n = 1}^{\infty} \frac{p x^{pn}}{pn} - \frac{p x^{pn+1}}{pn+1}.$$

If we differentiate this power series, we get $$\sum_{n = 1}^{\infty} p x^{pn - 1} - p x^{pn} = p x^{p-1} \frac{1-x}{1 - x^p}.$$ Integrating this (say via a partial fraction decomposition) and then choosing the constant of integration so that you get zero when $x = 0$ gives a formula for the original power series. Now putting $x = 1$ gives the value you want.

E.g. if $p = 2$, we have
$$2 x \frac{1}{1+x} = 2 - \dfrac{2}{1+x},$$ whose desired integral is $$2x - 2\log (1+x),$$ and so the value of the sum in this case is $2-2\log 2.$

E.g. if $p = 3$, we have $$3 \frac{x^2}{1+x+x^2} = 3 - 3\frac{1+x}{1+x+x^2} = 3 - \frac{3}{2} \frac{2x+1}{1+x+x^2} - \frac{3}{2}\frac{1}{3/4+ (x+1/2)^2},$$ whose desired integral is $$3 x - \frac{3}{2}\log(1+x+x^2) - {\sqrt{3}}\arctan\bigl(\frac{2x+1}{\sqrt{3}}\bigr)+\sqrt{3} \frac{\pi}{6},$$ and so the value of the sum in this case is $$3 - \frac{3\log 3}{2} - \frac{\sqrt{3} \pi}{6}.$$

I didn't try to find the general formula here. One part of mathematics where it is worked out is the theory of special values (at $s = 1$) of Dirichlet $L$-series.

[Added: it seems that between when I began writing this yesterday, and when I finally got a chance to finish and post it now, other answers with related derivations have appeared. Oh well.]

• I appreciate your approach. Thanks +1... – draks ... Jul 12 '14 at 21:25