ecm(n) returns the sorted prime factors of n, after trial division by
the primes below 100000. B1 and B2 are the even stage 1 and stage 2
bounds and max_curve the number of curves tried per factor. Random curves
come from a stream private to the call, seeded by seed.