Recent content by fernanroy

  1. F

    Write a Lisp program to calculate the sum of the first N positive integers

    This attempt yields the error: *** Read error: The input could not be tokenized at 2, 2. *** > (defun sum (n1 n2) “Returns the sum of two positive integers.” (assert (and (integerp n1) (>= n1 0)) (n1) “N1 must be a nonnegative integer, instead it’s ~S.” (n1)...
  2. F

    Write a Lisp program to calculate the sum of the first N positive integers

    Would it be something like this? (defun nsum (n) (if (integerp n) (if (or (= n 0) (< n 1)) Please enter the positive integer (* n(/ 2(+ n 1)))))) Regards
  3. F

    Write a Lisp program to calculate the sum of the first N positive integers

    Help! Please I am trying to 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 Any Ideas?
  4. F

    Brain Teaser: Solve Chocolate Bar Puzzle in Min Breaks

    YES! Thanks so much! I appreciate it!
  5. F

    Brain Teaser: Solve Chocolate Bar Puzzle in Min Breaks

    Thank You! Makes sense now that I look at it! Would you elaborate w+m-2?
  6. F

    Brain Teaser: Solve Chocolate Bar Puzzle in Min Breaks

    A friend of mine is really pulling my chain. He said the answer to this was right in front of me. I doubt that! Does anyone have an idea on this? "I have a bar of chocolate 6 blocks wide by 9 blocks long and I want to split it into its individual blocks making the smallest number of breaks...
Back
Top