Hi, here is one solution with Seq.fold.

let find vf =

let lcm a b =

let rec gcd (x, y) =
match (x, y) with
| (x, y) when y = 0 -> x
| _ -> gcd (y, x % y)

a * b / gcd (a, b)

seq { 1..vf } |> Seq.fold (fun s e -> lcm s e) 1

Regards

By on 5/6/2011 8:12 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper