I found this in my files a couple of days ago. It's very small, but all my own work; a program that runs the Sieve of Eratosthenes (sp?) to generate prime numbers without actually doing any calculations. Written in BASIC (yeah, I know...) Anyway, here it is:
'Sieve of Eratosthenes prime number generator without calculations
dim primes(1000)
n=2
for x=4 to 1000 step 2
primes(x)=1
next x
for x=2 to 1000
if primes(x)=0 then
for y=x+x to 1000 step x
primes=1
next y
end if
next x
for x=2 to 1000
if primes(x)=0 then print x;" ";
next x
'Sieve of Eratosthenes prime number generator without calculations
dim primes(1000)
n=2
for x=4 to 1000 step 2
primes(x)=1
next x
for x=2 to 1000
if primes(x)=0 then
for y=x+x to 1000 step x
primes=1
next y
end if
next x
for x=2 to 1000
if primes(x)=0 then print x;" ";
next x