Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/python
# print prime number between 2 - N with re module, where N is argv[1]
# very very slow
import sys,re
r = re.compile('^(..+)\\1+$')
N = int(sys.argv[1])
for i in xrange(2,N):
if not r.match('x' * i):
print i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.