# Convergence of a piecewise defined series

I have the following series $$1+\frac12-\frac13+\frac14+\frac15-\frac16 ...$$ How can I test this series for convergence? I'm not able to come up with any formula for the series apart from defining it piecewise like $$a_n= \begin{cases} \frac{-1}n & 3\mid n \\ \frac1n & 3\nmid n \end{cases}$$ Even if there is a simple formula for my series that I just haven't thought of, more generally if you have a series that can't be defined any other way than piecewise how do you test it for convergence?

Would proving each piecewise part converges/diverges be sufficient to prove that the series converges/diverges? (If thats the case what happens when some parts diverge and other parts converge?)

• The sum of the first $3$ is greater than $1$, the sum of the first $6$ is greater than $1+\frac{1}{4}$, the sum of the first $9$ is greater than $1+\frac{1}{4}+\frac{1}{7}$, and so on. This diverges, compare with $1/3$ of the harmonic series. Or show these sums are unbounded by comparison with an integral. – André Nicolas Apr 7 '15 at 3:15
• @André thank you, but i'm not quite sure on how you get that the first 3n sums must be greater than 1+1/4 + 1/7 ....although I can certainly see that this is true. – void life Apr 7 '15 at 3:45
• The part $\frac{1}{2}-\frac{1}{3}$ is positive, so the sum of the first three terms is greater than $1$. The part $\frac{1}{5}-\frac{1}{6}$ is positive, so the sum of the second group of three terms is greater than $\frac{1}{4}$. The part $\frac{1}{8}-\frac{1}{9}$ is positive, so the sum of the third group of three terms is greater than $\frac{1}{7}$. Similarly, the fourth group of three terms has sum greater than $\frac{1}{10}$, and so on. – André Nicolas Apr 7 '15 at 4:04
• Hint: Try using a trick very similar to this one to prove that the alternating series diverges. If the numerator of each third term would be $2$, then it would converge to $\ln3$. – Lucian Apr 7 '15 at 5:45
• @André right, I think I get it now, the of partial sums after every 3 terms will always be more than the series 1 + 1/4 + 1/7 + ...+ 1/(3n + 1). Which as you pointed out diverges. So as the sequence of the partial sums will diverge and hence the series will diverges. Does that sound right? – void life Apr 7 '15 at 8:21

Notice that:

$$\begin{eqnarray*}\lim_{N\to +\infty}\sum_{n=0}^{N}\left(\frac{1}{3n+2}-\frac{1}{3n+3}\right)&=&\lim_{N\to +\infty}\int_{0}^{1}\sum_{n=0}^{N}x^{3n}(x-x^2)\,dx\\&=&\int_{0}^{1}\frac{x}{1+x+x^2}\,dx\\&=&\log\sqrt{3}-\frac{\pi}{18}\sqrt{3}\end{eqnarray*}$$ hence your series is divergent since $$\sum_{n=0}^{N}\frac{1}{3n+1}\geq\sum_{n=0}^{N}\frac{1}{3n+3}=\frac{H_{N+1}}{3}$$ is divergent.