Proof of Theorem 7.3 from Bela Bollobas' Random Graphs I'm trying to figure out a certain bound in a proof of theorem of connectivity of random graphs. This is from a book of Bela Bollobas titled Random Graphs.

What is the probability that for some $r$, $3 < r < n/2$, our random
graph $G_p$ contains a component of order $r$? Since a component of order
$r$ contains a tree of order $r$ whose vertices are joined to no vertex outside
the tree, this probability is at most
\begin{align} \sum_{r = 3}^{\lfloor\frac{n}{2}\rfloor} \binom{n}{r} r^{r - 2} p^{r - 1}  (1 - p)^{r(n - r)} 
&\leq \sum_{r = 3}^{\lfloor\frac{n}{2}\rfloor} nr^{-\frac{5}{2}} 
\exp\left( r + r \log \log n + r \log 2\\ 
- r(\log n + c + o(1)) + \frac{r^2}{n}(\log n + c + o(1))\right)\\
&\leq n \sum_{r = 3}^{\lfloor\frac{n}{2}\rfloor} r^{-\frac{5}{2}} \exp (-2r (\log n)/5) \leq n^{-\frac{1}{5}}
\end{align}

Here, it is assumed that $p = \frac{\log n + c}{n}$, where $c$ is a constant.
I understand the first inequality but for the rest I have no idea. I'm also looking at another article where they make a similar argument and cite this book, so I would really appreciate an explanation.
 A: To prove the second inequality, we want to prove that
$$
   \exp\left( r + r \log \log n + r \log 2
- r(\log n + c + o(1)) + \frac{r^2}{n}(\log n + c + o(1))\right) \le \exp (-2r (\log n)/5).
$$
For this, we say that $\frac{r^2}{n} \le \frac{r \cdot \frac n2}{n} = \frac r2$, so $-r(\log n + c + o(1)) + \frac{r^2}{n}(\log n + c + o(1))$ is at most $-\frac12 r(\log n + c + o(1))$ (possibly with a different $o(1)$ after all that).
The other terms here are less significant, and to see that clearly, we just shove them into the factor of $r$, getting
$$
   -\frac12 r (\log n + c - 1 - \log\log n - \log 2 + o(1)).
$$
Now take $n$ large enough that $\log n - c - 1 - \log\log n - \log 2 + o(1) \ge \frac45 \log n$, and we see that the exponent is bounded by $-\frac25 r\log n$, which was what we wanted.

For the third inequality, rewrite $\exp(-2r(\log n)/5)$ as $n^{-2r/5}$. Because $r \ge 3$ for all terms of the sum, $n^{-2r/5} \le n^{-6/5}$. Using this bound, we get
$$
    n \sum_{r = 3}^{\lfloor\frac{n}{2}\rfloor} r^{-\frac{5}{2}} \exp (-2r (\log n)/5) \le n \sum_{r=3}^{\lfloor\frac{n}{2}\rfloor} r^{-\frac52} n^{-6/5} \le n^{-1/5} \sum_{r=3}^\infty r^{-\frac52}.
$$
Here, I've extended the sum past $\lfloor \frac n2\rfloor$ to $\infty$ as an upper bound, because it converges, and it converges to a value less than $1$. (Specifically, it converges to $\zeta(\frac52) - 1 - 2^{-5/2}$, which Mathematica tells me is about $0.164$, but we don't need that much precision.) So the infinite sum can be discarded, leaving just $n^{-1/5}$.
