Skip to content

Instantly share code, notes, and snippets.

@vedantk
Created August 3, 2011 05:37
Show Gist options
  • Save vedantk/1121978 to your computer and use it in GitHub Desktop.
Save vedantk/1121978 to your computer and use it in GitHub Desktop.
Direct translation of f(n) into Scheme.
(define (f n)
(if (< n 3)
n
(+ (f (- n 1))
(* 2 (f (- n 2)))
(* 3 (f (- n 3))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment