RosettaCodeData/Task/Mutual-recursion/OCaml/mutual-recursion.ocaml

8 lines
109 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
let rec f = function
| 0 -> 1
| n -> n - m(f(n-1))
and m = function
| 0 -> 0
| n -> n - f(m(n-1))
;;