Solving $y^2 = 4x^3 - p$, with prime $p \equiv 7 (\text{mod } 8)$

125 Views Asked by At

I'm trying to find integer solutions to equations of the form $$y^2 = 4x^3 - p \tag{1}$$ where $p$ is a prime and $p \equiv 7 (\text{mod } 8)$.

1) Is there a simple way to check if solutions do not exist for a given $p$?

2) Is there a computationally efficient way to find at least one solution? or maybe for a subset of $p$ by assuming some additional property?


Eventually I'd like to solve for some large $p$ ( > 1000 bits). I do not know if this can be done efficiently, but I'm starting with smaller $p$ to try to understand properties of the equation better.

For reasonable sized values, I can use magma to test out some values of $p$. I do this by noting that if there is an integer solution to $Y^2 = X^3 - 16p$ with $X$ a multiple of 4, then I have solved the original equation. This has helped me see that sometimes there are no solutions, but I haven't figured out if there is a simple way to determine when this occurs.

2

There are 2 best solutions below

0
On

Partial result:

If $x$ is odd then we have modulo 8:

$$ -1\equiv 4-y^2\implies y ^2 \equiv 5$$ which is impossible.

So, if there is a solution then $x$ must be even.

0
On

47 fails. I don't know how much sage would slow down with larger $p$

jagy@phobeusjunior:~$ sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath Version 6.9, Release Date: 2015-10-10                     │
│ Type "notebook()" for the browser-based notebook interface.        │
│ Type "help()" for help.                                            │
└────────────────────────────────────────────────────────────────────┘
sage:  E = EllipticCurve([0,0,0, 0, -112])
sage: E.integral_points()
[(8 : 20 : 1)]
sage:  E = EllipticCurve([0,0,0, 0, -368])
sage: E.integral_points()
[(8 : 12 : 1),
 (9 : 19 : 1),
 (24 : 116 : 1),
 (32 : 180 : 1),
 (48 : 332 : 1),
 (944 : 29004 : 1),
 (1313 : 47577 : 1)]
sage:  E = EllipticCurve([0,0,0, 0, -496])
sage: E.integral_points()
[(8 : 4 : 1),
 (16 : 60 : 1),
 (25 : 123 : 1),
 (40 : 252 : 1),
 (113 : 1201 : 1),
 (560 : 13252 : 1)]
sage:  E = EllipticCurve([0,0,0, 0, -752])
sage: E.integral_points()
[]
sage:  E = EllipticCurve([0,0,0, 0, -1136])
sage: E.integral_points()
[(96 : 940 : 1)]
sage: