RosettaCodeData/Task/Stern-Brocot-sequence/F-Sharp/stern-brocot-sequence-1.fs

3 lines
132 B
Forth

// Generate Stern-Brocot Sequence. Nigel Galloway: October 11th., 2018
let sb=Seq.unfold(fun (n::g::t)->Some(n,[g]@t@[n+g;g]))[1;1]