Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let rec Lucas x =
- match x with
- | x when x <= 0 -> failwith "Errore! x <= 0"
- | 1 -> 1
- | 2 -> 3
- | x -> Lucas (x - 1) + Lucas (x - 2)
- [<EntryPoint>]
- let main argv =
- printfn "Lucas (2) = %i" (Lucas 2)
- printfn "Lucas (3) = %i" (Lucas 3)
- printfn "Lucas (5) = %i" (Lucas 5)
- 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement