Problem 1
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

At the moment of writing this, #1 is the easiest problem in all Project Euler, measured by how many people have claimed to solve it. This problem is small enough that, in theory, this could be done by hand with some patience and a cheap calculator. However, the problems will get larger and larger and calculations must be optimized in order to solve them within the suggested time of 1 minute. Therefore, it's necessary for the prospective puzzle solver to understand good strategies even for the simplest cases. Consider the following:
  1. The modulo operation can be loosely defined as the remainder of the division of x/y. In other words, this is how much x deviates from being a perfect multiple of y. How can this be used in this particular problem?
  2. Consider the fact that 15 is both a multiple of 3 and 5. How can you detect numbers like this that may throw off your calculation? How can you avoid double-counting it?

← Project Euler Guide |Problem 1| Project Euler Guide: Problem 2 →