Theorem (integral test)
Suppose $f: [1,\infty)\to\R$ is positive and decreasing. As $n\to\infty$, $$ \begin{align*} \sum_{r=1}^{n} f(r) - \int_{1}^{n} f(x)\, dx \to l \end{align*} $$ for some $0\leq l\leq f(1)$.
In particular $\int_{1}^{\infty} f$ converges iff $\sum_{n=1}^{\infty} f(n)$ converges.