mccarthy-m91-function


The McCarthy 91 function named for John McCarthy of lisp programming fame!

 (define (mc91 n) 
   (display n) 
   (cond ((< n 1) (display "Function only defined for positive values of n")) 
         ((<= n 100) (mc91 (mc91 (+ n 11)))) 
         (else (- n 10)))) 

category-code