title: Using recursion to sum numbers
body: <p>I have just been studying the concept of recursion and I thought that I would try a simple example. In the following code, I am attempting to take the numbers: 1, 2, 3, 4, 5, and add them together using recursion. I expected the result to be 15, but my code is returning 16.</p>
  <p>What am I doing wrong?</p>
  <h3>Code:</h3>
  <pre><code>    static void Main(string[] args)
      {
          
          Console.WriteLine(Sum(5));
          Console.Read();
      }
  
  
      static int Sum(int value)
      {
          if (value &gt; 0)
          {
            return value + Sum(value - 1);
          }
          else
          {
              return 1;
          }
      }
  </code></pre>