title: Lisp Sum of power
body: <p>Define a function "power" that takes two input arguments m and n, and returns m^n. Then, by using the function "power", define a function sum_power that takes two input arguments m and n and returns the sum: (1^n + 2^n + 3^n +.... + m^n).</p>
  
  <p>int first function i calculate power from given arguments in second function a sum powers. But program gives error: Program stack overflow. RESET...
  I cant find my error. Function power is correct I checked.</p>
  
  <pre><code>(defun power(m n)
    (let ((result 1))
      (dotimes (count n result)
        (setf result (* m result)))))
  
  (defun sum_power (m n)
    (if (= 0 m)
        0
        (+ (powern m) 
           (sum_power (1- m) n))))
  </code></pre>