open System let rec s (d:DateTime) = seq { yield d yield! s (d.AddDays(1.0)) } let sd = DateTime.Parse("2015/01/01") let ed = DateTime.Parse("2015/12/31") s sd |> Seq.takeWhile ((>=)ed) |> Seq.filter (fun d -> let dd = d.ToString("dd") |> Seq.map (string >> int) |> Seq.reduce((+)) int(d.ToString("MM")) = dd ) |> Seq.length |> printfn "%A"