public void Get_Factorys__ValidValues() { var result = Factors.GetFactors(8).ToList(); Assert.IsTrue(result.Contains(1)); Assert.IsTrue(result.Contains(2)); Assert.IsTrue(result.Contains(4)); Assert.IsTrue(result.Contains(8)); }
static bool HasAtLeastNumberOfDivisors(int numberOfDivisors, long triangleNumber) { return(Factors.GetFactors(triangleNumber).Count() >= numberOfDivisors); }
public void Get_Factorys_Of_1_Returns_1() { var result = Factors.GetFactors(1).ToList(); Assert.IsTrue(result.Contains(1)); }
public string LinqSolve() { return(Factors.GetFactors(600851475143).ToList().Where(x => x.IsPrime()).OrderBy(x => x).Last().ToString()); }
public override object Run(RunModes runMode, object input, bool Logging) { return(Factors.GetFactors((long)input).Where(fac => Primes.IsPrime((long)fac)).Max()); }