The upper bound is 2540160, since (factorial 9)*7 = 2540160 and (factorial 9)^x grows faster than 10^x for x >= 7.
let problem34b = {3..2540160} |> Seq.filter (fun i -> i = (i |> string |> Seq.map (string >> int) |> Seq.sumBy factorial)) |> Seq.sum
Learning F# through Project Euler
No comments:
Post a Comment