Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 14 lines (13 sloc) 0.24 kB
c4fa206 @williamstein Initial version
williamstein authored
1 def primes(kmax):
2 p = []
3 k = 0
4 n = 2
5 while k < kmax:
6 i = 0
53960e8 Py3k fixes
Stefan Behnel authored
7 while i < k and n % p[i] != 0:
c4fa206 @williamstein Initial version
williamstein authored
8 i = i + 1
9 if i == k:
10 p.append(n)
11 k = k + 1
12 n = n + 1
13 return p
Something went wrong with that request. Please try again.