# Sage usage to calculate a cardinality

I would like to compute the cardinality of an elliptic curve group over the finite field $\mathbb{F}_{991}$. I'm trying to use sage but I still have an error in the syntax (I never used it before and I tryed to adapt a code). Here is what I have:

sage: E = EllipticCurve(GF(991))

sage: E

Elliptic Curve defined by y^2 = x^3 + 446*x + 471 over Finite Field of order 991

Does some one know how I should modify it?

-

sage: E.cardinality()


But, you need to first input your curve, say you have an elliptic curve given by $$E: y^2+a_1xy+a_3y=x^3+a_2x^2+a_4x+a_6 \text{ over } GF(p)$$

Then, do this,

sage: E=EllipticCurve(GF(p),[a_1,a_2,a_3,a_4,a_6])
sage: E.cardinality()


Hope this helped.

-
To be far, ask.sagemath.org is only available to those with a certain rep there currently, due to spammers... but I would suggest stackoverflow.com as a more appropriate venue, yes. Is it possible to migrate a question there? – kcrisman May 22 '14 at 13:16
@kcrisman ask.sagemath.org works the same way as math.se, so I don't see why OP can't ask this question there. You only need to register and you should be able to ask a question with just $1$ rep, just like the way it is here. – BlackAdder May 23 '14 at 0:28
Unfortunately, we had to close off the 1 rep threshold due to very aggressive spammers. I think it's now 10, though the plan is to go back soon. – kcrisman May 23 '14 at 0:44
@kcrisman That's a pity, and I didn't know that. Thanks for the info! – BlackAdder May 23 '14 at 2:55
I think this forum is a fine place for this question. – Álvaro Lozano-Robledo May 23 '14 at 13:46

Alternatively, you can use MAGMA online. I usually do it like this:

K:=GF(991);

g:=Generator(K);

E:=EllipticCurve([0,0,0,446*g,471*g]);

#E;

and MAGMA returns 984.

-