in reply to Prime Numbers

If you want fast results, search on cpan for prime.

If you want your own approach to work for larger numbers, use bigint.