test3-extended.gp (1307B)
1 read("400k-3.gp"); 2 /* Testing all ECs with a 3-torsion point, conductor < 4*10^5 and rank > 0 */ 3 /* Taken from LMFBD */ 4 5 S = List(); 6 7 { 8 for( i = 1, length( data ), 9 if( i % 100 == 1, print( "Tested ", i-1, " curves." ); ); 10 coeffs = data[i]; 11 E = ellinit( coeffs ); 12 f3 = elldivpol( E, 3 ); /* 3-division polynomial */ 13 eqn = y^2 + E[1]*x*y + E[3]*y - x^3 - E[2]*x^2 - E[4]*x - E[5]; /* eqn of E */ 14 res = substpol( polresultant( f3, eqn ), y, x ); /* Keep x for consistency */ 15 K3 = nfinit( polredbest( nfsplitting( res, 6 ) ) ); 16 E_ext = ellinit( coeffs, K3 ); 17 Egens = ellgenerators(E); 18 for( j = 1, length( Egens ), 19 P = Egens[j]; 20 if( ellisdivisible( substpol(E_ext,x,y), P, 3, &Q ), 21 cremona_label = ellidentify(E)[1][1]; 22 listput( S, [cremona_label, P, Q] ); 23 write( "pari-output-ext", cremona_label ); 24 write( "pari-output-ext", P ); 25 write( "pari-output-ext", Q ); 26 print( "Found EC ", cremona_label, " with point ", P ); 27 /* Check for 3-divisibility up to torsion */ 28 T = elltors(E)[3][1]; 29 if( ellisdivisible( E, elladd(E,P,T), 3 ), 30 print( "P+T_1 is 3-divisible!" ); 31 ); 32 T = ellmul(E,T,2); 33 if( ellisdivisible( E, elladd(E,P,T), 3 ), 34 print( "P+T_2 is 3-divisible!" ); 35 ); 36 ); 37 ); 38 ); 39 } 40