public static double Root(BigInteger i, int rootValue) { return(Math.Floor(Math.Exp(BigInteger.Log(i) / rootValue))); }
public IEnumerable <BigInteger> PrimeFactorsByRationalSieve(BigInteger value) { var bound = value < 10000 ? Math.Ceiling(MathHelpers.Sqrt(value)) : Math.Ceiling(Math.Pow(BigInteger.Log(value, 2), 3)); return(PrimeFactorsByRationalSieve(value, new BigInteger(bound))); }