We rewrite the equation in the form
3pn=4m3+m2+12m+3=(4m+1)(m2+3)
From this, we deduce that there exist natural numbers u,v,a,b such that 4m+1=3upa and m2+3=3vpb with u+v=1 and a+b=n.
If m=0, the equation becomes 3pn=3, so n=0 and any prime number works.
Now suppose m⩾1. Then 4m+1>3 and m2+3>3, so a⩾1 and b⩾1.
We have
16×3vpb=16(m2+3)=(4m)2+48=((4m+1)−1)2+48=32up2a−2×3upa+49
Since p divides the left-hand side, it divides the right-hand side, so p∣49, which gives p=7. We then replace 49 with p2:
16×3vpb=32up2a−2×3upa+p2
If a=1 then 4m+1 is 7 or 21. Since m is an integer, we have 4m+1=21, or m=5, which implies 3vpb=m2+3=28. Impossible. Therefore, a⩾2. We deduce that 32up2a−2×3upa+p2 is divisible by p2, so 16×3vpb is divisible by p2, hence b⩾2.
If a⩾3, then 16×3vpb=32up2a−2×3upa+p2 is congruent to p2 modulo p3, so it is not divisible by p3, therefore b=2. By dividing by p2, we get that 16×3v≡1[p]. For v=0 this gives 16≡1[7] and for v=1 this gives 48≡1[7]. Impossible.
Therefore, we must have a=2 and 4m+1=3u×49. If u=0 then m=12 and n=4. If u=1 then 4m+1=147, which is impossible.
Conclusion: the only solutions are
- m=0,n=0,p any prime, and
- m=12,n=4,p=7.