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$)


Solution 1:

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.

Solution 2:

$\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.