# Mistake in SageMathCell code, finding integral points on elliptic curves [closed]

I've the following number:

$$12\left(n-2\right)^2x^3+36\left(n-2\right)x^2-12\left(n-5\right)\left(n-2\right)x+9\left(n-4\right)^2\tag1$$

Now I know that $$n\in\mathbb{N}^+$$ and $$n\ge3$$ (and $$n$$ has a given value) besides that $$x\in\mathbb{N}^+$$ and $$x\ge2$$.

I want to check if the number is a perfect square, so I can rewrite $$(1)$$ as follows:

$$y^2=12\left(n-2\right)^2x^3+36\left(n-2\right)x^2-12\left(n-5\right)\left(n-2\right)x+9\left(n-4\right)^2\tag2$$

Where $$y\in\mathbb{Z}$$.

In this problem I've: $$n=71$$, the number is equal to;

$$y^2=57132x^3+2484x^2-54648x+40401\tag3$$

So, I used SageMathCell to look for the integral points on the elliptic curve and the code that was used is the following:

E = EllipticCurve([0, β, 0, γ, δ])
P = E.integral_points()
for p in P:
if p[0] % α == 0:
print(p[0] // α, p[1] // α)


I found the coeficients I need to use using equation $$(2)$$ and $$(3)$$ (but I do not know if they are corect):

• $$\alpha=12(71-2)^2=57132\tag4$$
• $$\beta=36(71-2)=2484\tag5$$
• $$\gamma=-144(71-5)(71-2)^3=-3122149536\tag6$$
• $$\delta=1296(71-4)^2(71-2)^4=131871507195024\tag7$$

So the final code looks like:

E = EllipticCurve([0, 2484, 0, -3122149536, 131871507195024])
P = E.integral_points()
for p in P:
if p[0] % 57132 == 0:
print(p[0] // 57132, p[1] // 57132)


But I found no solutions and it should give at least one solution at $$x=1585$$.

• Use EllipticCurve_from_cubic(y^2*z - (57132*x^3+2484*x^2*z-54648*x*z^2+40401*z^3)) to get a map from your cubic to a Weierstrass model without having to think. The forum for asking questions of this type is ask.sagemath.org. – Chris Wuthrich Dec 3 '19 at 15:39
• @ChrisWuthrich I've no idea what you mean by that comment, I'm sorry. – Jan Dec 3 '19 at 15:40
• Sorry, I hit enter too early and now I have edited the comment. – Chris Wuthrich Dec 3 '19 at 15:41
• I'm guessing that the SageMathCell computation timed out. I'm running SageMath on my desktop computer, and after running E = EllipticCurve([0, 2484, 0, -3122149536, 131871507195024]), the command P = E.integral_points() hasn't finished after more than an hour. – John Palmieri Dec 3 '19 at 18:06
• Voted to closed as this really belongs to another forum. – godelian Dec 3 '19 at 20:34

After about an hour and a half running SageMath 9.0.beta7 on my computer, I see this:

sage: E = EllipticCurve([0, 2484, 0, -3122149536, 131871507195024])
sage: P = E.integral_points()
sage: for p in P:
....:    if p[0] % 57132 == 0:
....:        print(p[0] // 57132, p[1] // 57132)
....:
(-1, 201)
(0, 201)
(1, 213)
(1585, 15083061)

• Just being curious: what is the rank of that curve? Usually the computation of the Mordell-Weil group is the main task in integral_points, but situation might be different here, since the curve has such a large height. BTW this code looks very familiar to me: math.stackexchange.com/questions/3459005/… – WhatsUp Dec 3 '19 at 19:50
• If you insert after the first line the command E.simon_two_descent(), then the whole thing only takes some minutes. The reason is that this line sets E.gens() faster than mwrank does. simon_two_descent even allows to give known points which could speed up a little bit further. - Moreover, since 57132 is divisible by 6 one can even switch to the global minimal model to recover all four points and that is done in seconds ! – Chris Wuthrich Dec 3 '19 at 21:20
• @WhatsUp: E.rank() returns 4. – John Palmieri Dec 3 '19 at 21:34
• @ChrisWuthrich: confirmed: E.simon_two_descent() takes 6.5 seconds, after which P = E.integral_points() takes under a second (as opposed to 80-90 minutes before). – John Palmieri Dec 3 '19 at 21:36
• @ChrisWuthrich Quite interesting! But I don't understand the logic here. In the documentation math.sciences.univ-nantes.fr/~sorger/chow/html/en/reference/… , it is mentioned This method is used internally by the rank(), rank_bounds() and gens() methods. But we don't supply any input here, so why does a mere default call to simon_two_descent (which is supposed to be used in e.g. rank()) speed up the computation? – WhatsUp Dec 3 '19 at 21:46