Solving Project Euler

Project Euler, which is named after the mathematician Leonard Euler, is a collection of maths problems that are to be solved using computer programming.

This posts begins a series entitled “Solving Project Euler” which is my take on how to solve the questions.

While some problems can be solved by brute force methods, others require clever algorithms.

We begin with Problem 1.

The problem is fairly straight forward.
Find the sum of numbers that are less than 1000, which are multiples of 3 OR 5.

General Algorithm

    1. Initialize a variable to store the sum.
    2. Iterate through all the numbers from 1 to 999.
    3. If the remainder after dividing the numbers by either 3 or 5 is zero add it to the sum.

Solution in C++

Leave a comment

1 Comment

  1. Anonymous

     /  January 14, 2012

    I suppose you shouldn’t post the solutions. Its purely unethical.


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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

  • Enter your email address to follow this blog and receive notifications of new posts by email.

    Join 8 other followers

  • Tweets

    Error: Twitter did not respond. Please wait a few minutes and refresh this page.

  • Recent Posts

  • Archives

  • Blog Stats

    • 3,559 People liked what they saw on this page
  • Advertisements
%d bloggers like this: