let rec factorial n = match n with | 0 -> 1 | x -> x * factorial (x-1) printfn "%d", factorial(5)