title: Recursion function to calculate the sum of squares in a sequence (and output the process)
body: <pre><code>int SeriesToOne(int n) {
     if (n == 1) {
         cout &lt;&lt; "(" &lt;&lt; 1 &lt;&lt; "*" &lt;&lt; 1 &lt;&lt; ") = ";
         return 1;
     }
     cout &lt;&lt; "(" &lt;&lt; n &lt;&lt; "*" &lt;&lt; n &lt;&lt; ") + ";
  return (n * n) + SeriesToOne(n - 1); }
  </code></pre>
  
  <p>Hey so I'm writing a program thats supposed to calculate the sum of squares in a sequence using recursion. </p>
  
  <p>I'm writing two functions, one that calculates it going from 1 to N and one that calculates it going from N to 1, and outputting the process. The above code is the function that I wrote for N to 1, but I'm having a lot of trouble with going from 1 to N. </p>
  
  <p>I don't know how to properly write out the base case and get to that base case without adding a second argument to the function (the assignment specifies one argument).</p>
  
  <p>If anyone could help me out, that'd be awesome! And sorry if I didn't format this post or put it in the wrong section, first time poster.</p>