Skip to content

Problem 13

November 21, 2009

For the 13th problem of the Euler project, I started by defining a list containing the one hundred numbers. So, it would be something like:

import Char

l = [37107287533902102798797998220837590246510135740250,



Then, it was a matter of defining a small function that would return the first 10 digits of the sum of all those numbers:

sumF :: [Integer] -> [Char]
sumF = take 10 . show . sum

The result (of executing sumF l) was achieved using the following timing/memory resources: (0.01 secs, 5340404 bytes)

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: