title: efficiently finding prime numbers in python
body: <p>here is my code:</p>
  
  <pre><code>def findPrimes():
     prime=True
     c=0
     n=1
     while n&lt;14:
          n=n+1
          for i in range(1,n):
              if n%i==0:
                  prime=False
          if prime==True:
              print(n)
     while c==0:
          n=n+1
          if (n%2==0) or (n%3==0) or (n%5==0)or (n%7==0)or (n%11==0)or (n%13==0):
              c=0#this does nothing
          else:
              for i in range(5,int(n**0.5),2):
                  if n%i==0:
                      break
              print(n)
  findPrimes()
  </code></pre>
  
  <p>it should output:
  2
  3
  5
  7
  11
  13
  17
  ...
  Instead, I get:
  17
  19
  23
  29
  31
  37
  41
  43
  47
  ...
  or(with break in a different indent):
  2
  3
  4
  5
  6
  7
  8
  9
  10
  11
  12
  13
  17
  19
  ...
  why is this?</p>