(defun partitionNum (a b) (if (= b 1) (list (list a)) (let ((x 0) (l '())) (while (<= x a) (progn (setq l (append l (list-of (append (list (- a x)) y) (y in (partitionNum x (- b 1)))))) (setq x (+ x 1)))) l))) (print (partitionNum 5 3))