public IEnumerable <BigInteger> Factor(BigInteger n) { var smallFactors = pollard.Factor(n); var c = n / smallFactors.Product(); if (c.IsOne) { return(smallFactors); } var largeFactors = quadraticSieve.Factor(c); return(smallFactors.Concat(largeFactors)); }
public static IEnumerable <int> PrimeFactors(int n) { return(factorerInt.Factor(n)); }