I've been reading Bruce Schneier's book Applied Cryptography, which is pretty awesome.
I'm interested in doing a little experimentation to help me better understand some of the mathematical concepts pertaining to trap door functions and key generation. In particular, I was thinking I might write a little PHP script to locate all the primes of bit length N to help me make some graphs so I understand a bit more about the distribution of prime numbers in a particular numeric range. Were I a better mathematician I could probably just take a look at Prime Number Theorem or perhaps the Riemann Zeta Function, but I figured I'd start small.
That said, anyone have suggestions for a good algorithm for locating all the Primes for an N-bit integer? I'm looking at the Sieve of Eratosthenes and the the Sieve of Atkin.