<s>[INST] Does $\sum_{n\ge0} \cos (\pi \sqrt{n^2+n+1}) $ converge/diverge? How would you prove convergence/divergence of the following series?
$$\sum_{n\ge0} \cos (\pi \sqrt{n^2+n+1}) $$
I'm interested in more ways of proving convergence/divergence for this series. 
My thoughts
Let
$$u_{n}= \cos (\pi \sqrt{n^2+n+1})$$
Let's first check A necessary condition for the convergence of that seires  is that the limit $$\lim\limits_{n \to \infty} u_n$$ should exist and be equal $0$
but i have answer in my old book but i can't remember how they got that
$$u_n=\cos \left(n\pi+\frac{\pi}{2}+\frac{3\pi}{8n}+o(\frac{1}{n^2})\right)=\frac{(-1)^{n+1}.3\pi}{8n}+o(\frac{1}{n^2})$$
since $|\frac{(-1)^{n+1}.3\pi}{8n}|$ decreasing. and converge $0$
then by compraison $u_n$ is convergent
any help would be appreciated
 [/INST] From the Taylor expansion
$$
(1+x)^{1/2}=1+\frac{x}{2}-\frac{x^2}{8}+O(x^3)
$$
we get
$$\begin{align}
\sqrt{n^2+n+1}&=n\Bigl(1+\frac{1}{n}+\frac{1}{n^2}\Bigr)^{1/2}\\
&=n\Bigl(1+\frac{1}{2}\Bigl(\frac{1}{n}+\frac{1}{n^2}\Bigr)-\frac{1}{8}\Bigl(\frac{1}{n}+\frac{1}{n^2}\Bigr)^2+O\Bigl(\frac{1}{n}+\frac{1}{n^2}\Bigr)^3\Bigr)\\
&=n+\frac12+\frac{3}{8\,n}+O\Bigl(\frac{1}{n^2}\Bigr).
\end{align}$$
Thus
$$
\cos(\pi\sqrt{n^2+n+1})=\cos\Bigl(\Bigl(n+\frac12\Bigr)\pi+\Bigl(\frac{3\,\pi}{8\,n}+O\Bigl(\frac{1}{n^2}\Bigr)\Bigr)
$$
Now use the formula for the cosine of a sum and take into account that
$$
\cos\Bigl(\Bigl(n+\frac12\Bigr)\pi\Bigr)=0,\quad\sin\Bigl(\Bigl(n+\frac12\Bigr)\pi\Bigr)=(-1)^n.
$$
</s>