Diophantine Equation: a²+p³=b⁴

2022 Apr 20

The nice thing about math videos on youtube is that sometimes the statement for the problem to be solved in the video is simple enough to fit in the thumbnail. In that case, you can just read the problem off the thumbnail and try to solve it yourself without watching the video. One such problem (from a Michael Penn video I think) is to find the smallest prime p that solves the following equation (where the variables must all take on integer values):
a^2 + p^3 = b^4
The way this will work, is there will be a couple of places where we analyse by cases, and always there will be only one path that provides solutions, and any other path will be a dead end. We'll call such cases where there are no solutions "dead cases", and give proofs that they are empty of solutions. Cases that harbor solutions will correspondingly be called "living cases". The starting point will be to rearrange and factor:
p^3 = b^4 - a^2 = (b^2-a)(b^2+a)
Without loss of generality, we can take a to be positive, which implies that both factors must be positive, so we have 2 cases:
Dead Case:
We can then reason as follows:
2b^2 = p^2+p = p(p+1)
If p is 2, then 2b²=6, and b cannot be an integer.
If p is greater than 2, then 2b² contains exactly one factor of p, so b cannot be an integer.
Living Case:
We can then reason as follows:
a = b^2 - 1
b^2 + a = 2b^2 - 1 = p^3
It will be useful to eliminate the possiblity that p=2 in all subsequent reasoning, so that we can assume that p is an odd prime. This can be seen by plugging 8 for p³ above, and observing that there are no solutions.
2b^2 = p^3 + 1 = (p+1)(p^2 - p + 1)
Note that only the p+1 factor can be even. Also, the overall product must be twice a square. So we can find positive numbers x, y, z, with y being squarefree and both y and z being odd such that:
p+1 = 2x^2 y
p^2-p+1 = yz^2
This implies:
Since y divides both p+1 and p-2, y must be equal to 1 or 3.
Second Dead Case:
We can then reason as follows:
p^2-p+1 = z^2
Note that since p is an odd prime:
p > 2
(p-1)^2 = p^2 - 2p + 1 < p^2-p+1 < p^2
Since z² would have to be between adjacent squares, there are no solutions in this case.
Second Living Case:
We can then reason as follows:
p+1 = 6x^2
z^2=1 \mod 4
p^2-p+1 = 3z^2 = 3 \mod 4
p^2-p = 2 = p(p-1) \mod 4
p-1 = 2 \mod 4
p+1 = 0 \mod 4
Therefore x² is even which means x is even. Let w = x/2. Then:
p=24w^2 - 1
Now we can start plugging in w=1,2,3,4... and see how soon we get a prime. The resulting sequence is:
p=23, 95, 215, 383, ...
It turns out that the very first element, p=23, is prime. That's our answer. Now constructing a solution to the equation is just a matter of subbing back for b and a:
b^2 = (p^3+1)/2 = 6084
b = \sqrt{6084} = 78
a = b^2-1 = 6084-1 = 6083
Therefore our solution to this equation is:
6083^2 + 23^3 = 78^4