| John Cremona on Thu, 18 Jun 2009 11:56:43 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| Fwd: Elliptic curve x^3 - y^2 = p |
I replied to the original poster when I meant to reply to pari-users.
---------- Forwarded message ----------
From: John Cremona <john.cremona@gmail.com>
Date: 2009/6/18
Subject: Re: Elliptic curve x^3 - y^2 = p
To: cino hilliard <hillcino368@hotmail.com>
It is in Sage (http://www.sagemath.org/):
sage: time EllipticCurve([0,0,0,0,-431]).integral_points()
CPU times: user 0.44 s, sys: 0.00 s, total: 0.44 s
Wall time: 1.77 s
[(8 : 9 : 1),
(11 : 30 : 1),
(20 : 87 : 1),
(30 : 163 : 1),
(36 : 215 : 1),
(138 : 1621 : 1),
(150 : 1837 : 1),
(575 : 13788 : 1),
(3903 : 243836 : 1)]
sage: time EllipticCurve([0,0,0,0,-503]).integral_points()
CPU times: user 0.46 s, sys: 0.01 s, total: 0.46 s
Wall time: 1.75 s
[(8 : 3 : 1),
(12 : 35 : 1),
(18 : 73 : 1),
(23 : 108 : 1),
(44 : 291 : 1),
(134 : 1551 : 1),
(294 : 5041 : 1),
(1008 : 32003 : 1)]
John Cremona
2009/6/18 cino hilliard <hillcino368@hotmail.com>:
> Hi ,
> I want to find the number of solutions of the elliptic curve, x^3 - y^2 = p
> for various p = 7, 431, 503, etc
>
> I have been using brute force in a Pari script below testing for solutions.
> diffcubesq2(n,p) =
> {
> local(a,c=0,c2=0,j,k,y);
> for(j=1,n,
> for(k=1,n,
> y=j^3-k^2;
> if(y==p,
> c++;
> print(j","k","y);
> );
> );
> );
> c;
> }
>
> diffcubesq2(10000,431) outputs
> 8,9,431
> 11,30,431
> 20,87,431
> 30,163,431
> 36,215,431
> 138,1621,431
> 150,1837,431
> (03:14:10) gp > ##
> *** last result computed in 6mn, 57,969 ms.
>
> My Pari code misses the last two solutions. It would have
> taken way too much time to get to y = 243836 anyway.
>
> From a example and link posted by David Broadhurst in another forum,
>
> http://magma.maths.usyd.edu.au/calc/
>
> I tried using the Magma applet to compute the elliptic curve.
> This gets all solutions in a fraction of the time.
>
> Does anyone have Pari script with elliptic curve functions that will
> do something like this?
>
>
> Examples: p = 7 has 2 solutions, p = 431 has 9
> Input:
> E := EllipticCurve([0, -7]);
> Q, reps := IntegralPoints(E);
> Q;
>
> Output:
> Magma V2.15-3 Thu Jun 18 2009 17:24:22 [Seed = 2348296821]
> -------------------------------------
> [ (2 : 1 : 1), (32 : -181 : 1) ]
> Total time: 0.350 seconds, Total memory usage: 136.95MB
>
> Input:
> E := EllipticCurve([0, -431]);
> Q, reps := IntegralPoints(E);
> Q;
>
> Output:
> Magma V2.15-3 Thu Jun 18 2009 17:33:07 [Seed = 3601166652]
> -------------------------------------
> [ (8 : 9 : 1), (20 : -87 : 1), (11 : -30 : 1), (30 : -163 : 1), (36 : 215 :
> 1),
> (138 : 1621 : 1), (150 : 1837 : 1), (575 : 13788 : 1), (3903 : -243836 : 1)
> ]
> Total time: 1.050 seconds, Total memory usage: 137.04MB
>
> Thanks,
> Cino
>
>