# Solving alternate infinite series

Suppose we have an alternating series of the form $$\sum_{n=2}^{\infty} \frac{(-1)^{f(n)}}{n^2} \text{ where } f(n) = \begin{cases}1 & \text{n is prime} \\ 0 & \text{otherwise}\end{cases}$$.

How would one go about proving that this series converges or not? Does this series have a closed form solution?

• It converges absolutely, so there is no problem with convergence. I doubt there is a convenient form for the sum, however. – lulu Feb 23 '18 at 14:26
• Can you see that $\left|\dfrac{(-1)^{f(n)}}{n^2}\right|\le\dfrac{1}{n^2}$? – egreg Feb 23 '18 at 14:27
• Yes this seems true and because of this equation the function converges absolutely and so has a finite limit less then $\frac{1}{n^2}$ Thank you for the response. – Razvan Feb 23 '18 at 14:34
• Just a little thing: pay attention to the domain of your terms. You can't evaluate $\frac{(-1)^m}{n^2}$ in $n=0$, and I don't know how you would define $f(n)$ for $n=0,1$, so I suggest to start from $n=2$. – Ottavio Bartenor Feb 23 '18 at 14:36
• I added the question to reflect this observation – Razvan Feb 23 '18 at 14:40