# Does this series converge or diverge?

Let us consider the series $$\sum_{n=1}^\infty \frac {\{\sqrt n\}-\frac 1 2} n$$, where $$\{\cdot\}$$ denotes the fractional part of a real number. On the one hand,

SumConvergence[(FractionalPart[Sqrt[n]] - 1/2)/n, n]


False

On the other hand,

NSum[(FractionalPart[Sqrt[n]] - 1/2)/n, {n, 1, Infinity}]


-0.725204

Let us investigate it. The output of

N[Table[Sum[(FractionalPart[Sqrt[n]] - 1/2)/n, {n, 1, 10^k}], {k, 1, 5}], 15]


{-0.679200513405746, -0.755781168886997, -0.803827960877609, -0.810978369858450, -0.816045768107535}

suggests the convergence, but the sum of the series does not equal -0.725204. Let us look at the plots

DiscretePlot[(FractionalPart[Sqrt[n]] - 1/2), {n, 1, 121}]


and

DiscretePlot[(FractionalPart[Sqrt[n]] - 1/2), {n, 121, 144}]


The plots show that approximately from k^2 to (k^2+(k+1)^2)/2 (k is a positive integer) the terms are negative and from (k^2+(k+1)^2)/2 to (k+1)^2 the terms are nonnegative. Let us estimate the sums over these intervals by

AsymptoticSum[1/n, {n, (k^2 + (k + 1)^2)/2, (k + 1)^2}, k -> Infinity]


 1/k

and

AsymptoticSum[1/n, {n, k^2, (k^2 + (k + 1)^2)/2}, k -> Infinity]


1/k

This also suggests the convergence. However, the above is a plausible reasoning, not a proof.

The questions are: how to accurately prove or disprove the convergence with Mathematica? how to numerically calculate the sum of the series under consideration?

• A harder question is about the series $$\sum_{n=1}^\infty \frac {\{\sqrt n\}-\frac 1 2} ne^{2\pi i t \log n} ,$$ where $t\in\mathbb R$ . Aug 6 '21 at 18:28
• BTW, SumConvergence[FractionalPart[Sqrt[n]]/n, n] results in True instead of False. Aug 7 '21 at 12:21

Here is my answer to my question done with Mathematica. If n>=k^2 && n<(k+1)^2, where k is a positive integer, then Floor[Sqrt[n]]==k and FractionalPart[Sqrt[n]]==Sqrt[n]-k. Now we consider

Sum[(Sqrt[n] -k-1/2)/n, {n,k^2,(k + 1)^2 - 1},Assumptions -> k\[Element] PositiveIntegers]


1/2 (2 HurwitzZeta[1/2, k^2] - 2 HurwitzZeta[1/2, (1 + k)^2] + PolyGamma[0, k^2] + 2 k PolyGamma[0, k^2] - PolyGamma[0, 1 + 2 k + k^2] - 2 k PolyGamma[0, 1 + 2 k + k^2])

Series[%, {k, Infinity, 2}]


-(2/(3 k^2))+O[1/k]^3

This implies the series under consideration converges. In order to obtain the numerical value of the sum, we find

NSum[1/2 (2 HurwitzZeta[1/2, k^2] - 2 HurwitzZeta[1/2, (1 + k)^2] +
PolyGamma[0, k^2] + 2 k PolyGamma[0, k^2] -
PolyGamma[0, 1 + 2 k + k^2] -
2 k PolyGamma[0, 1 + 2 k + k^2]), {k, 1, Infinity}]


-0.817595

• I'd like to elaborate the proof. Because of Series[Sum[(Sqrt[n] - k - 1/2)/n, {n, k^2, (k + 1/2)^2}], k -> Infinity] which results in -(1/(4 k))+O[1/k]^2 and Series[Sum[(Sqrt[n] - k - 1/2)/n, {n, (k + 1/2)^2, (k + 1)^2 - 1}], k -> Infinity] which results in 1/(4 k)+O[1/k]^2, the partial sum $S_n$ for $n\in [k^2,(k+1)^2]$ satisfies the estimates $$S_n \ge S_{k^2}- 1/(4k)+O(1/k^2),\,S_n \le S_{k^2}+1/(4k)+O(1/k^2).$$ The squeeze theorem ends the proof. Aug 8 '21 at 4:32