Sum of all numbers
<p>I need to write a function that calculates the sum of all numbers n.</p>

<pre><code>Row 1:          1 
Row 2:         2 3 
Row 3:        4 5 6 
Row 4:       7 8 9 10 
Row 5:     11 12 13 14 15 
Row 6:   16 17 18 19 20 21 
</code></pre>

<p>It helps to imagine the above rows as a 'number triangle.' The function should take a number, n, which denotes how many numbers as well as which row to use. Row 5's sum is 65. How would I get my function to do this computation for any n-value?</p>

<p>For clarity's sake, this is not homework. It was on a recent midterm and needless to say, I was stumped.</p>
