Be patient! Start with a low limit, to check it is working. If
you ask for more than 30 million primes, there may be a delay in the web page
responding. I think that this may be partly due to the sluggishness of
browsers, sometimes, and partly due to your PC running out of memory.
The algorithm I am using is crude. For one thing, it uses a lot of
memory. A simple improvement to speed, which I have incorporated, is to
consider only odd numbers. A further, related improvement would be to only
store data for odd numbers, which would halve the memory requirement; but I
have not made this (fairly simple) change to the code. There are other possible
improvements to the algorithm, such as eliminating the need for testing numbers
already known not to be prime, as the algorithm progresses. To view the
on the link to the <SCRIPT> file.
Number of primes less than N (from