[ prog / sol / mona ]

prog


[challenge] Inverse Factorial

4 2021-06-03 17:51 *
(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)))
22


VIP:

do not edit these