# Project Euler Problem 16

Project Euler Problem 16 can be done as-is: first let’s produce the number 2**1000 by shifting bigint 1I thousand times to the left; then convert its written representation into array of digits; and finally sum them.

let inline digit (x: char) = int(x) - int('0') let problem016 () = 1I <<< 1000 |> sprintf "%A" |> fun x -> x.ToCharArray() |> Array.map digit |> Array.sum

Advertisements

Leave a Comment