Using the $p-$ test $\Rightarrow \sum\limits_{n=1}^{\infty}\frac{1}{n^p}$ is convergent for $p>1$.
Using the comparison test $\Rightarrow$ $$a_n=\frac{\cos{nx}}{n^p},b_n=\frac{1}{n^p}$$
then $a_n$ is convergent if $p>1$ and divergent if $p\le 1$.
Is this the only necessary condition for convergence of $a_n$?