ONLY DO WHAT ONLY YOU CAN DO

こけたら立ちなはれ 立ったら歩きなはれ

F# で Project Euler Problem 16

> System.Numerics.BigInteger.Pow(2I,15);;
val it : System.Numerics.BigInteger = 32768I
> System.Numerics.BigInteger.Pow(2I,100);;
val it : System.Numerics.BigInteger = 1267650600228229401496703205376I
> System.Convert.ToString (System.Numerics.BigInteger.Pow(2I,100));;
val it : string = "1267650600228229401496703205376"
> (System.Convert.ToString (System.Numerics.BigInteger.Pow(2I,100))).ToCharArray();;
val it : char [] =
  [|'1'; '2'; '6'; '7'; '6'; '5'; '0'; '6'; '0'; '0'; '2'; '2'; '8'; '2'; '2';
    '9'; '4'; '0'; '1'; '4'; '9'; '6'; '7'; '0'; '3'; '2'; '0'; '5'; '3'; '7';
    '6'|]
> (System.Convert.ToString (System.Numerics.BigInteger.Pow(2I,100))).ToCharArray() |> Array.map(int);;
val it : int [] =
  [|49; 50; 54; 55; 54; 53; 48; 54; 48; 48; 50; 50; 56; 50; 50; 57; 52; 48; 49;
    52; 57; 54; 55; 48; 51; 50; 48; 53; 51; 55; 54|]
> (System.Convert.ToString (System.Numerics.BigInteger.Pow(2I,100))).ToCharArray() |> Array.map(int) |> Array.map(fun n -> n - 48);;
val it : int [] =
  [|1; 2; 6; 7; 6; 5; 0; 6; 0; 0; 2; 2; 8; 2; 2; 9; 4; 0; 1; 4; 9; 6; 7; 0; 3;
    2; 0; 5; 3; 7; 6|]
> (System.Convert.ToString (System.Numerics.BigInteger.Pow(2I,100))).ToCharArray() |> Array.map(int) |> Array.map(fun n -> n - 48) |> Array.sum;;
val it : int = 115
> (System.Convert.ToString (System.Numerics.BigInteger.Pow(2I,1000))).ToCharArray() |> Array.map(int) |> Array.map(fun n -> n - 48) |> Array.sum;;
val it : int = 1366