 <p>The logic of your recursive function is just wrong. You never actually read the contents of the array. I'm surprised you got any meaningful output out of that.</p> <p>You need to rethink of the recursive definition to perform this addition.</p> <p>Base case(s):<br> Sum of an empty array is <code>0.</code>.<br> i.e., <code>sum_of_array(x, 0) == 0.</code></p> <p>Sum of a 1-element array is the value of the element.<br> i.e., <code>sum_of_array(x, 1) == x[0]</code></p> <p>Recursive case:<br> Sum of an n-element array is the sum of the nth element and the sum of the first <code>n-1</code> elements.<br> i.e., <code>sum_of_array(x, n) == x[n-1] + sum_of_array(x, n-1)</code></p> <p>Figure out how to encode this logic in your function.</p>