Skip to content

Instantly share code, notes, and snippets.

@matinkaboli
Last active September 21, 2017 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matinkaboli/8882c4c63e5ae149b44d036cc4a18d1c to your computer and use it in GitHub Desktop.
Save matinkaboli/8882c4c63e5ae149b44d036cc4a18d1c to your computer and use it in GitHub Desktop.
i = 3
n = s = 1
while (i <= 10001):
if (s == 1):
x = 6 * n -1
s = 0
else:
x = 6 * n +1
s = 1
n = n + 1
r = x ** .5
p = 1
t = 3
while (t <= r):
if (x % t == 0):
p = 0
t = t + 2
if (p == 1):
i = i + 1
print(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment