Do the series converge? Let $g \colon \mathbb{N} \rightarrow \{0,1\}$ such that $g(n)=0$, if $n \equiv 0$ or $n \equiv 1 ~(\bmod~4)$; or  $g(n)=1$, if $n \equiv 2$ ou $n \equiv 3 ~(\bmod~4)$.
Do $\sum_{n=1}^\infty \frac{(-1)^{g(n)}}{\sqrt{n}}$ converge?
The series is something like this

*

*If $n=1$, then $\frac{(-1)^{g(n)}}{\sqrt{n}} = \frac{(-1)^{0}}{\sqrt{1}} = 1$, partial sum of 1


*If $n=2$, then  $\frac{(-1)^{g(n)}}{\sqrt{n}} = \frac{(-1)^{1}}{\sqrt{2}} \approx -0.707$, partial sum of  $\approx$ 0.293


*If $n=3$, then $\frac{(-1)^{g(n)}}{\sqrt{n}} = \frac{(-1)^{1}}{\sqrt{3}} \approx -0.577$, partial sum of  $\approx$ -0.284


*If $n=4$, then $\frac{(-1)^{g(n)}}{\sqrt{n}} = \frac{(-1)^{0}}{\sqrt{4}} = 0.5$, partial sum of $\approx$ 0.216


*$\cdot\cdot\cdot$ and goes on
What I thought of doing?

*

*Break the series (call it $a_n$) into two ($b_n$ and $c_n$), where $b_n$ is the positive terms and make the negative terms = $0$; and $c_n$ is only the negative terms, and the terms which are indices of positive = $0$. So we have an equality of $a_n = b_n - c_n$. If I show that either $b_n$ or $c_n$ diverges then $a_n$ diverges?

*I know, by using Alternate Series Test, that $\sum _{n=1}^{\infty }\frac{(-1)^n}{\sqrt{n}}$ converges, but does this also means $\sum_{n=1}^\infty \frac{(-1)^{g(n)}}{\sqrt{n}}$ converges? It is not properly a reordering, so I have my doubts.

I am not sure of any of the ways, so thats why I am here. Thank you.

The series converges by Dirichlet's test. In the notation of the Wikipedia article, let $a_n=\frac1{\sqrt n}$, and let $b_n=(-1)^{g(n)}$.  Then $\mid\sum_{k=1}^n b_k\mid\leq2$ and the test applies.
