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);
        }
Exemple #2
0
 public static int FactorialDigitSum(int n)
 {
     return(MiscFunctions.SumOfDigits(CombinatoricFunctions.factorial(n)));
 }