Skip to content

Instantly share code, notes, and snippets.

@KarthikMAM
Last active April 18, 2016 17:23
Show Gist options
  • Save KarthikMAM/db2e6c7c185d10f2aa5189c73f40ffeb to your computer and use it in GitHub Desktop.
Save KarthikMAM/db2e6c7c185d10f2aa5189c73f40ffeb to your computer and use it in GitHub Desktop.
n = int(input()) + 1
x = { i for i in range(2, n) for j in range(2, int(i ** 0.5 + 1)) if i % j == 0 }
print([ i for i in range(2, n) if i not in x ])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment