Skip to content

Instantly share code, notes, and snippets.

@prayagupa
Created May 8, 2015 03:47
Show Gist options
  • Select an option

  • Save prayagupa/1aca670ac7520a9d8b83 to your computer and use it in GitHub Desktop.

Select an option

Save prayagupa/1aca670ac7520a9d8b83 to your computer and use it in GitHub Desktop.
LISP, ELISP
;;http://isites.harvard.edu/fs/docs/icb.topic623349.files/emacs_lisp.pdf
(defun fib-rec (n)
"finds the nth Fibonacci number using recursion"
(if (<= n 1)
1
(+ (fib-rec (- n 1)) (fib-rec (- n 2)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment