summaryrefslogtreecommitdiffstats
path: root/one/eleven.scm
blob: 68e8ce373cf53ca9725da601cbd366059d62b0bf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
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)))))))