Project Euler – Problem 48 Solution

Problem

The series, 11 + 22 + 33 + … + 1010 = 10405071317.

Find the last ten digits of the series, 11 + 22 + 33 + … + 10001000.

Solution

let number = [1..1000] |> List.map (fun n -> pown (bigint(n)) n) |> List.sum

let answer = 
    number.ToString().ToCharArray() 
    |> Array.rev
    |> Seq.take 10 
    |> Seq.toArray 
    |> Array.rev