Created
November 5, 2012 08:24
-
-
Save enigmaticape/4015999 to your computer and use it in GitHub Desktop.
(h)n = 2^(h-1) SICP Exercise 1.10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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/