
4. Find all pairs of prime numbers $(p, q)$ for which

$$
7 p q^{2}+p=q^{3}+43 p^{3}+1
$$


4. We start by observing that in the equation $7 p q^{2}+p=q^{3}+43 p^{3}+1$ the numbers $p$ and $q$ cannot both be odd. Otherwise, $7 p q^{2}+p$ would be even, while $q^{3}+43 p^{3}+1$ would be odd. Since 2 is the only even prime number, we conclude that $p=2$ or $q=2$.

In the case $p=2$, we obtain the equation $14 q^{2}+2=q^{3}+344+1$, which can be rewritten as $q^{3}-14 q^{2}=-343$. This shows that $q$ must be a divisor of $343=7^{3}$, hence $q=7$. Substitution confirms that $(p, q)=(2,7)$ is indeed a solution since $14 q^{2}+2=2 \cdot 7 \cdot 7^{2}+2$ and $q^{3}+344+1=$ $7^{3}+\left(7^{3}+1\right)+1=2 \cdot 7^{3}+2$ are equal.

Next, we consider the case that $q=2$ and $p$ is odd. This results in the equation $28 p+p=$ $8+43 p^{3}+1$. Since $p$ is odd, we see that $28 p+p$ is odd, while $8+43 p^{3}+1$ is even. Hence, no solutions exist in this case.

We conclude that $(p, q)=(2,7)$ is the only solution.
