TITLE: Convergence of the series $\sum_n (-1)^{\lfloor \sqrt{n-1}\rfloor} \frac 1 n$
QUESTION [6 upvotes]: Let's consider the series $\sum a_n$, with $$a_n = (-1)^{\lfloor \sqrt{n-1}\rfloor} \frac 1 n$$
It looks absolutely like an example for the Leibniz test but here the signs don't interchange one for one. How can we prove the convergence of this series?

REPLY [4 votes]: You can reduce the question to a question about Liebniz series by inserting parenthesis around the terms that have the same sign. The original series $\sum_{n=1}^{\infty} a_n$ is:
$$ \frac{1}{1} - \frac{1}{2} - \frac{1}{3} - \frac{1}{4} + \frac{1}{5} + \dots + \frac{1}{9} - \frac{1}{10} - \dots. $$ 
Denote the partial sums of the series $\sum_{n=1}^{\infty} a_n$ by $S_n = \sum_{k=1}^n a_k$. Inserting parenthesis around the terms with the same sign, we obtain a new series $\sum_{n=1}^{\infty} b_n$:
$$ \frac{1}{1} - \left( \frac{1}{2} + \frac{1}{3} + \frac{1}{4} \right) + \left( \frac{1}{5} + \dots + \frac{1}{9} \right) - \dots $$
Formally, what we do is we define $b_n$ by letting
$$ c_n = \sum_{k=(n-1)^2 + 1}^{n^2} \frac{1}{k}, \\
   b_n = (-1)^{n+1} c_n = (-1)^{n+1} \sum_{k=(n-1)^2 + 1}^{n^2} \frac{1}{k}. $$
Denote by $T_n$ the partial sums of the series $\sum_{n=1}^{\infty} b_n$. The fact that the new series $\sum_{n=1}^{\infty} b_n$ is obtained by inserting parenthesis around the terms corresponds to the fact that the sequence of partial sums of $\sum_{n=1}^{\infty} b_n$ is a subsequence of the sequence of partial sums of $\sum_{n=1}^{\infty} a_n$. Namely, $T_n = S_{n^2}$. If we can show that $c_n$ are monotonically decreasing to zero, we will obtain that $\sum_{n=1}^{\infty} b_n$ is a Liebniz series and hence converges. This shows that $S_{n^2}$ has a limit. Since the series $\sum_{n=1}^{\infty} b_n$ was obtained from the series $\sum_{n=1}^{\infty} a_n$ by inserting parenthesis around terms that have the same sign, this implies that $S_n$ also has a limit (the same limit).
Estimating $c_n$, we have
$$ c_n = \sum_{k=(n-1)^2 + 1}^{n^2} \frac{1}{k} \leq \sum_{k=(n-1)^2 + 1}^{n^2} \frac{1}{(n-1)^2 + 1} = \frac{n^2 - (n-1)^2}{(n-1)^2 + 1} = \frac{2n - 1}{(n-1)^2 + 1} \xrightarrow[n \to \infty]{} 0 $$
so $c_n$ tends to zero.
Finally,
$$ c_n - c_{n+1} = \sum_{k=(n-1)^2 + 1}^{n^2} \frac{1}{k} - \sum_{k=n^2 + 1}^{(n+1)^2} \frac{1}{k} \\ 
= \sum_{i = 0}^{2n - 2} \left(  \frac{1}{(n-1)^2 + 1 + i} - \frac{1}{n^2 + 1 + i} \right) - \frac{1}{(n+1)^2 - 1} - \frac{1}{(n+1)^2} \\
= \sum_{i = 0}^{2n - 2} \frac{2n - 1}{\left( (n-1)^2 + 1 + i \right) \left( n^2 + 1 + i \right)} - \frac{1}{(n+1)^2 - 1} - \frac{1}{(n+1)^2} \\
\geq  \frac{(2n-1)^2}{\left( (n-1)^2 + 1 + (2n-2) \right) \left( n^2 + 1 + (2n-2) \right)} - \frac{1}{(n+1)^2 - 1} - \frac{1}{(n+1)^2} \\
\geq \frac{(2n-1)^2}{n^2(n^2 + 2n - 1)} - \frac{2}{(n^2 + 2n - 1)^2} \\
= \frac{2(n-1)^2 - 1}{(n^2 + 2n + 1)^2} > 0 $$
for $n > 1$ which shows that $c_n$ are monotonically decreasing.