28Dec/080
Problem 13: Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.
This is not a tough problem for lisp or erlang. Some bright spark in the forum simply states that he cut and paste the list and wrapped it with (+ ) and had the result. I think the size of the numbers presents problems for some languages and the optimization is to only sum the first eleven digits of the long numbers since we only need the first 10 digits of the result.
I am lazy so I went the cut and paste option...
prob13() ->
BigNumbers = [ELIDED],
lists:sublist(integer_to_list(lists:sum(BigNumbers)), 1, 10).
So sum the list and then take the first 10 digits of the result. If you want to see the list of numbers they are here.