title: A bit of math and logic
body: <p>So I have this problem here: </p>
  
  <blockquote>
    <p>If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9.<br>
    The sum of these multiples is 23.<br>
    Find the sum of all the multiples of 3 or 5 below 1000.</p>
  </blockquote>
  
  <p>And I wrote this here:</p>
  
  <pre><code>def multiples(num, below):
      counter = 1
      z = 0
      while True:
          x = num * counter
          if x &lt; below:
              z += x
          else:
              break
          counter += 1
      return z
  below = 1000
  print "Multiples of 3: " + str(multiples(3, below))
  print "Multiples of 5: " + str(multiples(5, below))
  print "Added: " + str(multiples(3, below) + multiples(5, below))
  </code></pre>
  
  <p>If I set <code>below</code> to 10 I get the right answer, 23</p>
  
  <pre><code>Multiples of 3: 18
  Multiples of 5: 5
  Added: 23
  </code></pre>
  
  <p>But when I set it to 1000 I get this:</p>
  
  <pre><code>Multiples of 3: 166833
  Multiples of 5: 99500
  Added: 266333
  </code></pre>
  
  <p>And this is supposedly wrong, is there something I'm not getting?</p>