I have a question related to solving a nested summation equation with a recursive function.
Suppose I have an equation of:
So, I tried to solve this problem by using a for loop to solve the summation equation and using a recursive function to expand the order of nested summation.
test(3,0)function [sum] = test(a,b)sum = 0;for i=1:a-bif a-b == 1sum = 1;elsesum = sum + (a-b) * test(a,b+i);endendend
From the code I got
ans = 9
I appreciate any help, thanks.