using System;
public class Program
{
/*
Given three integers, i, j, and k, a sequence sum to be the value of
i + (i + 1) + (i + 2) + (i + 3) + … + j + (j − 1) + (j − 2) + (j − 3) + … + k (increment from i until it equals j,
then decrement from j until it equals k). Given values i, j, and k, calculate the sequence sum as described.
Example
i = 5
j = 9
k = 6
Sum all the values from i to j and back to k: 5 + 6 + 7 + 8 + 9 + 8 + 7 + 6 = 56.
*/
Console.WriteLine(string.Format("The sequence sum with i={0}, j={1} and k={2} is: {3}", i, j, k, SequenceSum(i, j, k)));
}