# points on elliptic curve

I have elliptic curve E : [0,0,0,-3267,45630], point P=[51,-108], as well as point Q=[-57,432] on elliptic curve F : [0,27,0,-4077,51705]. I want to find all (m,n) such that x(mP)=x(nQ). I tried doing it using Pari-gp unfortunately it keeps giving error (I am not sure why). Is there a way I can build this code using Sage.

for(m=1,10,for(n=1,10,XX=ellpow(E,P,m);YY=ellpow(F,Q,n);X=XX[1];Y=YY[1];if(X==Y,print(m "\t" n))))

edit retag close merge delete

@Sha - What have you tried?

( 2017-01-24 13:13:23 +0200 )edit

Sort by ยป oldest newest most voted

I guess the second point Q is given by [-57,216]. I use it in what follows.

    E=EllipticCurve([0,0,0,-3267,45630])
P=E([51,-108])
Q=E([-57,216])
[(m,n) for m in [1..10] for n in [1..10] if (m*P)[0]==(n*Q)[0]]


The result is:

[(2, 2), (4, 4), (6, 6), (8, 8), (10, 10)]


e.g. 2P=(339 : 6156 : 1) and 2Q=(339 : -6156 : 1).

more

1

Be careful: Looking at P[0] doesn't give you the affine x-coordinate. For instance, if you set

E=EllipticCurve([0,1,0,1,0])
P=E([0,0])
Q=E(0)


the code above would erroneously report that P and Q have the same x-coordinate

You could instead use

T=lambda(P,Q): P[0]*Q[2]==P[2]*Q[0]


or test (m*P).xy()[0] == (n*Q).xy()[0] which does look at the affine coordinates.

( 2017-01-25 01:45:38 +0200 )edit

@castor Sorry I may have to edit my question. Actually point Q is on elliptic curve F : ellinit([0,27,0,-4077,51705]). I overlooked that. Point P is on E, while Q is on elliptic curve F. I will edit my question.

( 2017-01-25 04:50:05 +0200 )edit
1

Thanks @nbruin for the correction, now using the second suggested test we may go as

E=EllipticCurve([0,0,0,-3267,45630])
P=E([51,-108])
F=EllipticCurve([0,27,0,-4077,51705])
Q=F([-57,432])
[(m,n) for m in [1..100] for n in [1..100] if (m*P).xy()[0] == (n*Q).xy()[0]]


the result is simply [].

( 2017-01-25 15:33:28 +0200 )edit

Thank you so much. I can play around with [1..100] to get the desired output.

( 2017-01-26 05:10:51 +0200 )edit