RosettaCodeData/Task/Factorial/Lean/factorial.lean

5 lines
98 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
def factorial (n : Nat) : Nat :=
match n with
| 0 => 1
| (k + 1) => (k + 1) * factorial (k)