Sieve of Eratosthenes in Python (2015)
Here is very concise implementation of sieve I use in algorithm contests:<p><pre><code>  int n = 100;
  vector&lt;int&gt; p(n);

  void sieve()
  {
      for(int i = 2; i &lt; n; i++)
          for(int j = i; j &lt; n; j += i) p[j]++;
  }

  int is_prime(int k)
  {
      return p[k] == 1;
  }</code></pre>