Meh.
(defun infac (n)
(loop for i from 0
for f = (fac i)
when (> f n) do (error "Not a factorial")
when (= f n) return i))
(define (inverse-factorial n)
(letrec ((iter
(lambda (i a)
(cond
((> a n) (error "Not a factorial!"))
((= a n) (- i 1))
(else (iter (+ i 1) (* a i)))))))
(iter 1 1)))