Ooh... don't compute every prime seprately :( If you know what range you need prime numbers up to, use the Sieve of Eratosthenes, or if you're feeling bold the Sieve of Atkin.