Sum $\sum_{n>1} g(n)/n$ over a set of with density $>1/2$

If $S=\{x_i\}$ is a set of positive integers with asymptotic density in the positive integers strictly greater than $1/2$, and $$g(n)=\begin{cases}-1&\text{if }\quad n\in S\\ 1&\text{otherwise} \end{cases}$$ Must the series $$\sum_{n>1} g(n)/n$$ diverge?

• I have tried thinking hard and long. – TROLLHUNTER Jun 29 '12 at 17:55
• @Barney: Try starting from the definition of density. We say that $S$ has density $\alpha$ if $\alpha=\lim_{N\rightarrow \infty}\frac{1}{N} \sum_{n\in S,\ n\leq N} 1=\alpha$, and now we know that $\alpha>\frac{1}{2}$. Unravel the definition of the limit, that is use the fact that for any $\epsilon$, there exists an $N$ so that etc.. etc... and the proof will follow naturally. – Eric Naslund Jun 29 '12 at 18:02
• $\alpha = \frac 12$ is tricky, but $\alpha > \frac 12$ should succumb easily to summation by parts – mike Jun 29 '12 at 21:30
• @mike: If $\alpha=1/2$, consider $S=2\mathbb Z$. – Jonas Meyer Jun 30 '12 at 2:06

Let $s(n):=\sum_{j=1}^ng(j)$ and $c_n:=\operatorname{card}(\{1,\ldots,n\}\cap S)$. Using summation by parts, we have \begin{align} \sum_{n=1}^N\frac{g(n)}n&=\sum_{j=1}^N\frac{s(j)}j-\sum_{j=0}^{N-1}\frac{s(j)}{j+1}\\ &=\frac{s(N)}N+\sum_{j=1}^{N-1}\frac{s(j)}{j(j+1)}. \end{align} We have $s(n)=n-2c_n$, and we can find $\delta>0$ such that for $n$ large enough, $$c_n\geq n\left(\frac 12+\delta\right).$$ We get $s(n)\leq n-n(1+2\delta)=-2n\delta$, hence for $j$ large enough $$\frac{s(j)}{j(j+1)}\leq -2\frac{\delta}{j+1}.$$ This shows that the sequence $\left\{\sum_{j=0}^N\frac{s(j)}{j(j+1)}\right\}$ is divergent to $-\infty$. Since $\left|\frac{s(n)}n\right|\leq 1$, we conclude that the series $\sum_{n\geq 1}\frac{g(n)}n$ is divergent.
Note that the hypothesis that the asymptotic density is $>1/2$ is necessary, otherwise, the set $S:=\{2n,n\in\Bbb N\}$ (of density $1/2$), we get the series $\sum_{n\geq 1}\frac{(-1)^n}n$, which is convergent.
• In this case, $s_n/n\to 0$, and we have to see with which speed. – Davide Giraudo Jun 30 '12 at 14:41