Archives

ProjectEuler.net

Posted: February 12th, 2009 | Author: | Filed under: Coding | Tags: , , | 1 Comment »

For those of you who have never stumbled on this site before, it just contains math problems that you need a computer to solve. I’ve been working myself on doing some of these problems in python, though they can be done in any language.

Right now there are ~250 problems up on the site, and as I was thinking it would be a cool idea to get some people together to go at some of these problems. Maybe even submit answers to all 250?

Here is an example of the 1st problem:

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000.

.. and my code in Python to solve it:

total = 0;
for i in range(0,1000):
    if ((i%3 ==0) or (i%5 ==0)):
        total = total + i;
print total;

At any rate — I’ve solved the first 10 & #215. They are a lot of fun, so check it out! If you wanted to look at any of the code for mine, just drop me a line @ bvgiarro@edisto.cofc.edu or comment on this post.

Link: [ProjectEuler.net]

-Brian Giarrocco