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));
        }
예제 #2
0
 public static IEnumerable <int> PrimeFactors(int n)
 {
     return(factorerInt.Factor(n));
 }