Created
July 9, 2014 02:27
-
-
Save anonymous/79221d59a836e57ff98c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def findPrimes(x): | |
numbers = [0]*x | |
char = 0 | |
for i in range(2,x): | |
#prime number | |
if numbers[i] != 1: | |
char += 2 ** (i % 8 -1) | |
yield i | |
#deleting primes from numbers | |
for j in range(i,x,i): | |
numbers[j] = 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment