Skip to content

Latest commit

 

History

History

fibonacci-seq

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

Fibonacci sequence

Write a function that computes the sequence of the first n Fibonacci numbers, with the following type:

val fib : int -> int list = <fun>

For instance, computing the first 10 elements of the sequence gives:

fib 10 ;;
- : int list = [0; 1; 1; 2; 3; 5; 8; 13; 21; 34; 55]