コード例 #1
0
 public static int Solution()
 {
     return(FibonacciSequence.SequenceBy(4000000).Where(x => x % 2 == 0).Sum());
 }
コード例 #2
0
        //-----------------------------------------------------------------
        //By considering the terms in the Fibonacci sequence whose values
        //do not exceed four million, find the sum of the even-valued terms.
        //Answer: 4613732
        //-----------------------------------------------------------------

        public override long Solve()
        {
            var sequence = FibonacciSequence.GenerateSequenceBelow(4000000);

            return(CalculateEvenTermsSum(sequence));
        }