Karim Belabas on Tue, 17 Jan 2017 17:38:34 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: your mail


* Benyamin Gholami [2017-01-17 15:18]:
> hi
> i want to calculate mestre sum S(E,N) for elliptic curves:
>  \sum ((-a_p)+2)/(p+1-(a_p))
> but i don't know its code in pari or sage .
> how can i do this?

I'm not sure what S(E,N) is; here's a guess:

S(E, N) =
{ my (s = 0.0);
  forprime(p = 2, N, my(a = ellap(E,p)); s += (2-a)/(p+1-a));
  return (s);
}


(17:37) gp > E = ellinit([0,0,0,1,1]); \\ y^2 = x^3 + x + 1 
(17:37) gp > S(E, 10^6)
time = 2,188 ms.
%2 = 4.8147746248168721613546571313173856035

Cheers,

    K.B.
--
Karim Belabas, IMB (UMR 5251)  Tel: (+33) (0)5 40 00 26 17
Universite de Bordeaux         Fax: (+33) (0)5 40 00 21 23
351, cours de la Liberation    http://www.math.u-bordeaux.fr/~kbelabas/
F-33405 Talence (France)       http://pari.math.u-bordeaux.fr/  [PARI/GP]
`