4. Given prime numbers $p$ and $q$, such that $p^{3}-q^{5}=(p+q)^{2}$. Then $\frac{8\left(p^{2013}-p^{2010} q^{5}\right)}{p^{2011}-p^{2009} q^{2}}=$ $\qquad$.
4. 140.

If $p$ and $q$ have the same remainder when divided by 3, and since $p$ and $q$ are both prime numbers:
If the remainder is 0 when divided by 3, then $p=q=3$, at this time,
$$
p^{3}-q^{5}=0 \Rightarrow 3^{3}>q^{5} \Rightarrow q^{5}<27,
$$

such a prime number $q$ does not exist.
Therefore, it can only be $q=3$, and $p^{3}-243=(p+3)^{2}$, which means
$$
p\left(p^{2}-p-6\right)=252=2^{2} \times 3^{2} \times 7.
$$

Thus, $p$ must be one of the numbers 2, 3, 7.
Upon inspection, only $p=7$ satisfies the equation.
Therefore, $p=7, q=3$.
$$
\begin{array}{l}
\text { Hence } \frac{8\left(p^{2013}-p^{2010} q^{5}\right)}{p^{2011}-p^{2009} q^{2}}=\frac{8 p^{2010}\left(p^{3}-q^{5}\right)}{p^{2009}\left(p^{2}-q^{2}\right)} \\
=\frac{8 p(p+q)^{2}}{(p-q)(p+q)}=\frac{8 p(p+q)}{p-q} \\
=\frac{8 \times 7(7+3)}{4}=140 .
\end{array}
$$