Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Leonardo-numbers/OCaml/leonardo-numbers.ocaml
Normal file
11
Task/Leonardo-numbers/OCaml/leonardo-numbers.ocaml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
let seq_leonardo i =
|
||||
let rec next b a () = Seq.Cons (a, next (a + b + i) b) in
|
||||
next
|
||||
|
||||
let () =
|
||||
let show (s, a, b, i) =
|
||||
seq_leonardo i b a |> Seq.take 25
|
||||
|> Seq.fold_left (Printf.sprintf "%s %u") (Printf.sprintf "First 25 %s numbers:\n" s)
|
||||
|> print_endline
|
||||
in
|
||||
List.iter show ["Leonardo", 1, 1, 1; "Fibonacci", 0, 1, 0]
|
||||
Loading…
Add table
Add a link
Reference in a new issue