FLINT3.7.0-dev

n_factor_ecm

Synopsis#include <flint/ulong_extras.h>
int n_factor_ecm(ulong * f, ulong curves, ulong B1, ulong B2, flint_rand_t state, ulong n)source

The elliptic curve method [Len1987; ZD2006] for a single-limb n, trying up to curves random curves with stage bounds B_1 and B_2. Returns 1 or 2 if a factor was found in stage I or II, -1 if one was found while selecting a curve, and 0 on failure. The factor is stored in *f.

References#

  • [Len1987] H. W. Lenstra, Jr., "Factoring integers with elliptic curves", Annals of Mathematics 126 (1987), 649–673
  • [ZD2006] P. Zimmermann and B. Dodson, "20 years of ECM", Algorithmic Number Theory (ANTS VII), LNCS 4076 (2006), 525–542
Cite this page

The FLINT team, “n_factor_ecm (ulong_extras.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/ulong_extras/n_factor_ecm.html (generated 2026-10-20).