Skip to content

Instantly share code, notes, and snippets.

View kg86's full-sized avatar

kg kg86

  • LegalOn Technologies
  • Tokyo, Japan
View GitHub Profile
import sys
 
M=[True] * 1000000
M[0] = M[1] = False
for i in xrange(2, len(M)):
  # print i
  if M[i]:
    j = i + i
    while j < len(M):
      M[j] = False
import sys
 
M=[True] * 1000000
M[0] = M[1] = False
for i in xrange(2, len(M)):
  # print i
  if M[i]:
    j = i + i
    while j < len(M):
      M[j] = False