let ``No.796 well known``() = stdin.ReadLine() |> int |> fun arg -> let rand = System.Random ( System.DateTime.Now.Millisecond ) let rec factList l = match l with | [] -> 0m | [x] -> x | x::xs -> x * factList xs let rec loop n = let l = seq {for i in [1..n] do yield rand.Next(312456 / n) |> decimal } |> Seq.toList if (l |> List.sum) % 3m = 1m && (l |> factList ) % 3m = 0m then l else loop n loop arg |> Seq.iter (fun s -> s |> stdout.Write ; stdout.Write " ") stdout.WriteLine "" () ``No.796 well known``()