diff options
-rw-r--r-- | one/eleven.scm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/one/eleven.scm b/one/eleven.scm new file mode 100644 index 0000000..68e8ce3 --- /dev/null +++ b/one/eleven.scm @@ -0,0 +1,12 @@ +;;; Under Creative Commons Attribution-ShareAlike 4.0 +;;; International. See +;;; <https://creativecommons.org/licenses/by-sa/4.0/>. + +(define-module (one eleven) + #:export (recursive-fn)) + +(define (recursive-fn n) + (cond ((<= n 3) n) + (else (+ (* 1 (recursive-fn (- n 1))) + (* 2 (recursive-fn (- n 2))) + (* 3 (recursive-fn (- n 3))))))) |