Presently sponsored by Serverless Guru: Your guide to cloud excellence, helping you every step of your serverless journey, including team training, pattern development, mass service migrations, architecting, and developing new solutions. Speak to a Guru today.
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