I have a factor program that runs and outputs to stdout all the prime numbers that are specified in the given paramters, in this case 30000000-31000000.
(but my favourite would be RudiC's approach)
--
Edit as disdeorgue correctly remarked the would not with for square numbers..
So adjusting for that, the first one becomes :
@disedorgue, you are right... I didn't stop to think how the factor program would work and only looked at the input file. The first one is still usable, with a bit of adjustment.