Skip to content

Instantly share code, notes, and snippets.

@enigmaticape
Created November 5, 2012 08:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enigmaticape/4015999 to your computer and use it in GitHub Desktop.
Save enigmaticape/4015999 to your computer and use it in GitHub Desktop.
(h)n = 2^(h-1) SICP Exercise 1.10
;; Recursively defined analogue of (h n) = (A 2 n)
(define (h-rec n)
(cond ((= n 0) 0)
((= n 1) 2)
(else (expt 2 (h-rec (- n 1))))))
@enigmaticape
Copy link
Author

From discussion of solution to Exercise 1.10 of Structure and Interpretation of Computer Programs (SICP), particularly variously restrained Ackermann functions. Blog at http://www.enigmaticape.com/blog/sicp-exercise-1-10-ackermanns-antics/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment