Exemplo n.º 1
0
        public IEnumerable <int> GetPrimeFactors(int number)
        {
            if (number < 2)
            {
                return(new List <int>());
            }

            var squareRoot = (int)Math.Sqrt(number);
            var primes     = _primeService.GetPrimesUpTo(squareRoot);

            return(PrimeFactorize(number, primes));
        }