Last active
August 29, 2015 14:18
-
-
Save RussellAndrewEdson/7d8dc2217abe2179ecb1 to your computer and use it in GitHub Desktop.
The recursive H function from Godel, Escher, Bach.
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
(defn h | |
"The recursive H function from Godel, Escher, Bach: takes | |
in an integer n and returns H(n) = n - H(H(H(n-1))), with H(0) = 0." | |
[n] | |
(if (= n 0) | |
0 | |
(- n (h (h (h (- n 1))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment