No significant improvement in this stage, becouse I wanted to build
the prime number generator, which does not require any mathematical
knowledge (no shortcuts). I could probably change some small things,
but that would results in a improvements in the range of n second per
cycle (cycle is now (n+1)*n/2 seconds). This are small improvements,
the generator would take 29 minutes instead 30 to reach number 33.
Some shorcuts, which are not used and could be:
Example 1: If number is not divided with 2, than it also will not be
divided by any multiply of 2 (4, 6, 8 ...). The generator is "stupid"
and still checks if number can be divided by 4, 6, 8....
Example 2: We all know that is enough to test numbers smaller than
sqrt (n) to see, if the number n is prime. I do not know and until now
I did not try how to produce sqrt (n). I could limit the checking to n/
3, or something like that, but this is again shortcut, obtained from
However, while answering you question, I got an idea for mathematical
knowledge based prime number generator...