二项式定理(计算机的解释)
(3+4)^n
(defun pow (num count)
(if (> count 0)
(* num
(pow num
(- count 1) ) )
1))
(defun expr (i j)
(if (or (eq i (1+ j))(eq j 0) )
1
(+ (expr (- i 1)
j )
(expr (- i 1)
(- j 1) ))))
(defun exprsum (start end)
(if (< end 0)
0
(+ (exprsum start (- end 1))
(* (expr start end )
(pow 3 end )
(pow 4 (- (1- start) end ))))))
(defun direct (n)
(pow 7 n))
(defun test (n)
(if (> n 0)
(progn
(print (exprsum (+ n 1)
n))
(print 'compare)
(print (direct n ))
(test (- n 1)))
(print 'over)))
(test 10)