Exemple #1
0
        public void Test_One()
        {
            /*
             * The sum of digits in the numerator of the 10th convergent is 1+4+5+7=17.
             */
            var sut = new E065ConvergentsOfE();

            Assert.Equal(17, sut.GetSumOfDigits(convergentNumber: 10));
        }
Exemple #2
0
        public void Solution()
        {
            /*
             * Find the sum of digits in the numerator of the 100th convergent of the continued fraction for e.
             */

            var sut = new E065ConvergentsOfE();

            Assert.Equal(272, sut.GetSumOfDigits(convergentNumber: 100));

            /*
             * Congratulations, the answer you gave to problem 65 is correct.
             *
             * You are the 26225th person to have solved this problem.
             *
             * This problem had a difficulty rating of 15%.
             */
        }
Exemple #3
0
        public void Test_SumOfDigits(int convergentNumber, int expecteedSum)
        {
            var sut = new E065ConvergentsOfE();

            Assert.Equal(expecteedSum, sut.GetSumOfDigits(convergentNumber: convergentNumber));
        }