Exemple #1
0
        public static int Get()
        {
            string wordLength = string.Empty;

            for (int i = 1; i <= 1000; i++)
            {
                var result = LIB.NumberToWords(i);
                wordLength += result;
            }
            int number = wordLength.Length - wordLength.Count(Char.IsWhiteSpace);

            return(number);
        }
        public static long Get()
        {
            int maxPalindrome = 0;

            for (int i = 100; i < 1000; i++)
            {
                for (int j = 100; j < 1000; j++)
                {
                    if (LIB.isPalindrome(i * j) && (i * j) > maxPalindrome)
                    {
                        maxPalindrome = i * j;
                    }
                }
            }
            return(maxPalindrome);
        }
Exemple #3
0
        public static long Get()
        {
            long number = 0;

            for (long i = 999999999; i > 0; i--)
            {
                string strNum = i.ToString();
                if (!strNum.Contains('0') && strNum.Length == strNum.Distinct().Count())
                {
                    if (LIB.IsPrime(i))
                    {
                        number = i;
                        break;
                    }
                }
            }
            return(number);
        }
Exemple #4
0
        public static long Get()
        {
            var result = LIB.sumOfDigits(LIB.Factorial(100));

            return((long)result);
        }
Exemple #5
0
        private static bool isAmicable(int number)
        {
            int result = LIB.divisorSum(number);

            return(result != number && LIB.divisorSum(result) == number);
        }