示例#1
0
        public static int DigitFactorials(int n)
        {
            int sum = 0;

            CombinatoricFunctions.generatefactorial(10);
            for (int i = 3; i < n; i++)
            {
                int[]      digits  = MiscFunctions.DigitsFromInt(i);
                BigInteger tempsum = 0;
                foreach (int digit in digits)
                {
                    tempsum += CombinatoricFunctions.factorial(digit);
                }
                if (tempsum == i)
                {
                    sum += i;
                }
            }
            return(sum);
        }