Animations of Hendrik Lenstra’s Elliptic Curve Factorization Algorithm (aka ECM), checking if 1997 is a prime number using the curves with x coefficients 23, 101 and 853.

This algorithm takes a curve over the field Z/nZ and using the Group Law on Elliptic Curves, “multiplies” a point P by a big integer (in this animations, I have used 720719). This multiplication is sped up using the double-and-add algorithm. If the algorithm couldn’t compute the next point during this multiplication, it would have found a factor of n.

When a point P turns blue in the animation, it means that P⊕P gives the green point. When two points P and Q = (0, 1) turn blue, the green point is the resultant of the Group Law P⊕Q.



CODE - YOUTUBE