Hi, I don't understand how this recursion is working , I need to convert it to iterative function

but without understanding i can't

Code:double sequence(int n) { double sum,i; if(n <= 30) return 2*n; else { for(sum =0,i = 1;i <= 30;i++) sum+= sequence(n-i); return sum/30; } }