Just as an example, running this in basic
Code:
10 rem -prime number sieve finds primes up to N,N< 2E+7
15 rem -max length of array f(*) must be (N/2)+3
20 dim f(10000003)
30 Input "N = "; N
35 t = timer : c=1
40 s = (N-3)/2
50 for i = 0 to s : f(i) = 1 : next i
60 for i = 0 to s
70 if f(i) = 0 then goto 110
80 p = i+i+3
85REM print p
90 for k = i+p to s step p : f(k) = 0 : next k
100 c = c+1
110 next i
120 print c;" primes found in ";
130 t = timer-t
140 print t;" seconds"
150 print "last prime found ="; p
160 goto 30
Nets my macbook a 3.3 second run time at one million numbers sifted if I recall correctly, although it might have been the 10 million run if it was possible. On the comparable windows machine, it took 13-17 seconds depending on the OS.