Longest hailstone sequence with starting number under one-million.

let hailstone n = Seq.unfold (function 0L -> None | 1L -> Some(1L, 0L)

                                     | n when n % 2L = 0L -> Some(n, n / 2L)

                                     | n -> Some(n, 3L * n + 1L)) n

let chainLen n = hailstone n |> Seq.length

let naturals = Seq.unfold (fun i -> Some(i, i + 1L)) 1L

let lengths = Seq.map chainLen naturals

let results = Seq.zip naturals lengths

results |> Seq.takeWhile (fst >> ((>=) 1000000L)) |> Seq.maxBy snd |> fst