4. Determine all prime numbers $p$ and $q$ that satisfy the equation

$$
(p+q)^{p}=(q-p)^{2 q-1}
$$
Solution. It cannot be that $q-p=1$, because $(q+p)^{p}>1$ for any prime numbers $p$ and $q$.

Let $r$ be a prime divisor of $q-p$, then $r$ is also a divisor of $q+p$, so it is a divisor of $2q = (q+p) + (q-p)$ and of $2p = (q+p) - (q-p)$. It follows that $p=q=r$ or $r=2$. The case $p=q$ is not possible, because the right-hand side would be zero, while the left-hand side is a positive number. According to this, it must be that $q-p=2^{k}$ and $q+p=2^{l}$ for some positive integers $k$ and $l$. From

$$
q=\frac{(q+p)+(q-p)}{2}=2^{l-1}+2^{k-1}
$$

it follows that for $k>1, 2 \mid q$, which is possible only for $q=2$, but then

$$
(q-p)^{2 q-1}<0<(p+q)^{p}
$$

so it must be that $k=1$. This means that $q-p=2$. On the other hand, we get

$$
l p=2 q-1=2 p+3
$$

so it must be that $3 \mid p$, i.e., $p=3$ and $q=5$. By verification, we find that these numbers satisfy the equation.