- or download this
use Math::Prime::Util qw/forprimes/;
forprimes { say } 1000; # optionally takes range a,b
- or download this
from sympy import sieve
for i in sieve.primerange(2,1000):
print i
- or download this
import gmpy2
n = 2
while n <= 1000:
print n
n = gmpy2.next_prime(n)
- or download this
from math import sqrt, ceil
...
for i in rwh_primes(1000):
print i