
Problem 2. Find all positive integers $m, n$, and primes $p \geq 5$ such that

$$
m\left(4 m^{2}+m+12\right)=3\left(p^{n}-1\right)
$$


Solution. Rewriting the given equation we have

$$
4 m^{3}+m^{2}+12 m+3=3 p^{n}
$$

The left hand side equals $(4 m+1)\left(m^{2}+3\right)$.

Suppose that $\left(4 m+1, m^{2}+3\right)=1$. Then $\left(4 m+1, m^{2}+3\right)=\left(3 p^{n}, 1\right),\left(3, p^{n}\right),\left(p^{n}, 3\right)$ or $\left(1,3 p^{n}\right)$, a contradiction since $4 m+1, m^{2}+3 \geq 4$. Therefore $\left(4 m+1, m^{2}+3\right)>1$.

Since $4 m+1$ is odd we have $\left(4 m+1, m^{2}+3\right)=\left(4 m+1,16 m^{2}+48\right)=(4 m+1,49)=7$ or 49 . This proves that $p=7$, and $4 m+1=3 \cdot 7^{k}$ or $7^{k}$ for some natural number $k$. If $(4 m+1,49)=7$ then we have $k=1$ and $4 m+1=21$ which does not lead to a solution. Therefore $\left(4 m+1, m^{2}+3\right)=49$. If $7^{3}$ divides $4 m+1$ then it does not divide $m^{2}+3$, so we get $m^{2}+3 \leq 3 \cdot 7^{2}<7^{3} \leq 4 m+1$. This implies $(m-2)^{2}<2$, so $m \leq 3$, which does not lead to a solution. Therefore we have $4 m+1=49$ which implies $m=12$ and $n=4$. Thus $(m, n, p)=(12,4,7)$ is the only solution.
