Пример #1
0
        public static bool IsPerfect(int target)
        {
            List <int> factors = FactorFinder.FindFactorList(target);
            int        sum     = SumFactors(factors);

            return(sum == target);
        }
        //this is here to offer a way that doesn't make the PrimeChecker class redundant.
        public static bool IsPrimeInefficient(int target)
        {
            List <int> factors = FactorFinder.FindFactorList(target);

            return(factors.Sum() != 1);
        }
 public static bool IsPrime(int target)
 {
     return(!FactorFinder.HasFactors(target));
 }