Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let next L =
- let l1 = L |> List.pairwise |> List.map (fun (a,b) -> a + b )
- 1::l1@[1]
- next [1;3;3;1]
- let pasc n =
- let rec pascrev (n:int): list<list<int>> =
- match n with
- | 1 -> [[1;1]]
- | _ -> match pascrev (n - 1) with
- | x::xs as prev-> (next x)::prev
- pascrev n |> List.rev
- pasc 5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement