Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Reverse factorial
(defun my-fac (num last total)
(if (> total num)
nil
(if (= (/ total num) 1)
last
(my-fac num (1+ last) (* (1+ last) total)))))
(my-fac 479001600 1 1)
;; 12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment