I'm really stuck trying to figure this out. Any pointers are useful! Here's the problem:<br><br>f(n) = n if n<4 <br>and <br>f(n) = f(n - 1) + 2f(n - 2) + 3f(n - 3) + 4f(n - 4) if n>= 4<br><br>Here's my solution so far -- any one know what I'm doing wrong?<br>
<br>(define (f n)<br><br> (define (f-iter result i)<br> (if (> i 4)<br> result<br> (f-iter (+ result (* i (- n i))) (+ i 1))<br> )<br> )<br><br> (if (< n 4)<br> n<br> (f-iter 0 1)<br>
)<br><br>)<br><br>(f 4) ;; should produce 10, produces 10<br>(f 5) ;; should produce 26, produces 20<br>(f 6) ;; should produce 63, produces 30<br>