- #1
fernanroy
- 7
- 0
Homework Statement
Write a Lisp program to calculate the sum of the first N positive integers where, for example, when N = 6 the sum of the first N = 21.
Homework Equations
If you try this out in tlisp at http://www.ugcs.caltech.edu/~rona/tlisp/ please note that the syntax for N - 1 is (+ N -1).
Or if you try it out in the console of Allegro Common Lisp from http://www.franz.com the syntax is (- N 1).
If you define your function as, for example, nsum, then the syntax for calling it with N = 6 is (nsum 6)
The Attempt at a Solution
Ok, I am no programmer so I don't even know where to start. This is not a programming class so I am not sure where to start.
Any help or direction would be appreciated!