Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def isprime(i, primes):
- for m in primes:
- if i % m == 0:
- return False
- return True
- def fprimes(n):
- primes = [2, 3]
- for i in xrange(5, n+1, 2):
- if isprime(i, primes):
- primes.append(i)
- return primes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement