Recently I have stumbled upon a question like this-
$$a_n = \begin{cases} \frac{1}{n} \ \mbox{ if } n \mbox{ is a perfect square} \\ \frac{1}{n^2} \ \mbox{ otherwise}, \end{cases}$$ Comment on the convergence or divergence of the series $\sum{a_n}$.
I am not sure but I thought like this- $$\sum{a_n} =\\(1+\frac{1}{4} +\frac{1}{9}+\frac{1}{4}+\frac{1}{25}+...)<2(1+\frac{1}{4}+\frac{1}{9}+...)<\infty$$ Thus $\sum{a_n}$ converges. But I am not sure if the steps are correct or not. Any help would be very much appreciated!
To make your idea rigorous, we can let $k$ be the largest integer so that $k^2\leq N$. We have $$ \sum_{n=1}^Na_n<\sum_{n=1}^k\frac1{n^2}+\sum_{n=1}^N\frac1{n^2}<2\sum_{n=1}^N\frac1{n^2}. $$ Now, use that the RHS converges.