cino hilliard on Thu, 18 Jun 2009 10:59:47 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Elliptic curve x^3 - y^2 = p |
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 |