# Given prime $p$, find solutions to $x^2 + p y^2 = z^3$

For a prime $$p$$ consider non-zero integers $$x,y,z$$ that satisfy: $$x^2 + p y^2 = z^3$$

Does this fit in a known class of Diophantine equations that have been studied already?

I'm not sure how to go about solving these. Looking at it mod $$p$$, it looks like it should be easy to just choose a $$z$$, cube it, check if the result is a quadratic residue and solve for $$x$$. But I'm not sure how to lift this to a solution in the integers. Or maybe that is just a horrible starting approach.

How can I find solutions to this equation?

• given any $n = u^2 + p v^2,$ there is a formula for $x^2 + p y^2 = n^3.$ If the class number $h(-4p)$ is larger than $1$ there may be more; an example would be $n = 3 u^2 + 2uv + 4 v^2$ leading to $n^3 = x^2 + 11 y^2.$ – Will Jagy Feb 11 '19 at 1:33

If $$z$$ is of the form $$x^2 + p y^2$$, then so is any power of $$z$$, since $$(a^2 + p b^2)(c^2 + p d^2) = (ac-pbd)^2 + p (ad + b c)^2$$ If there is unique factorization in $$\mathbb Z[\sqrt{-p}]$$, those are all the solutions.

For the equation: $$X^2+qY^2=Z^3$$

You can write this simple solution:

$$X=(p^2+qs^2)((p^4-q^2s^4)t^3-3(p^2+qs^2)^2kt^2+3(p^4-q^2s^4)tk^2-$$ $$-(p^4-6qp^2s^2+q^2s^4)k^3)$$

$$Y=2ps(p^2+qs^2)((p^2+qs^2)t^3-3(p^2+qs^2)tk^2+2(p^2-qs^2)k^3)$$

$$Z=(p^2+qs^2)((p^2+qs^2)t^2-2(p^2-qs^2)tk+(p^2+qs^2)k^2)$$

$$q -$$The ratio is given for the problem.

$$p,s,t,k -$$ integers asked us.

To describe the solutions of the equation. $$x^2+qy^2=z^3$$

I think best would be to describe a solution using $$3$$ parameters.

$$x=p^6+q(b^2+8bs-5s^2)p^4+q^2(s^2-b^2)(b^2-8bs-5s^2)p^2+q^3(s^2-b^3)^3$$

$$y=2p(q^2(2s+b)(s^2-b^2)^2+2qb(b^2-3s^2)p^2-(2s-b)p^4)$$

$$z=p^4+2q(s^2+b^2)p^2+q^2(s^2-b^2)^2$$

• How did you figure out that solution? – StarCrunch Feb 11 '19 at 7:58

Above equation shown below:

For $$p=3$$,

$$x^2+3y^2=z^3$$ ------$$(A)$$

Equation $$(A)$$ has solution:

$$(x,y,z)=[(6m^2+8),(3m^3+4m),(3m^2+4)]$$

For $$m=7$$ we get;

$$302^2+(3)(1057)^2=(151)^3$$