[racket] Sum of Even

From: Ashley Fowler (afowler2 at broncos.uncfsu.edu)
Date: Tue Sep 25 11:04:18 EDT 2012

I am trying to do a recursive analysis on the Sum of even numbers function. So far I have already defined the function. I have found the base case. The hard part is finding the non-recursive definition. I'm having trouble of what non-recursive definition even means.

Step 1 - Base case: sumEven(N) = 2, if N = 1

Step 2 - Non-recursive definition =

(define sumEven
    (lambda (N)
      (cond((= N 1) 2)
           ((> N 0) (*(+ N 1)N)))))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120925/5fed775c/attachment-0001.html>

Posted on the users mailing list.