Quad-power prime seeds: Difference between revisions
Content added Content deleted
m (→{{header|ALGOL 68}}: dodgy keyboard induced typo (again....)) |
(→{{header|ALGOL 68}}: should have mentioned the primes library...) |
||
Line 26: | Line 26: | ||
A sieve is used to (hopefully) quickly eliminate non-prime 2n+1 numbers - Miller Rabin is used for n^2+n+1 etc. that are larger than the sieve. |
A sieve is used to (hopefully) quickly eliminate non-prime 2n+1 numbers - Miller Rabin is used for n^2+n+1 etc. that are larger than the sieve. |
||
This is about 10 times slower than the equivalent Penta-powwr prime seed program, possibly because even numbers are included and the n+2 test in the Penta-powers eliminates more numbers before the higher powers must be calculated. |
This is about 10 times slower than the equivalent Penta-powwr prime seed program, possibly because even numbers are included and the n+2 test in the Penta-powers eliminates more numbers before the higher powers must be calculated. |
||
{{libheader|ALGOL 68-primes}} |
|||
<br> |
|||
NB: The source of the ALGOL 68-primes library is on a Rosetta Code code page linked from the above.<br> |
|||
Note that to run this with ALGOL 68G under Windows (and probably Linux) a large heap size must be specified on the command line, e.g. <code>-heap 1024M</code>. |
Note that to run this with ALGOL 68G under Windows (and probably Linux) a large heap size must be specified on the command line, e.g. <code>-heap 1024M</code>. |
||
<lang algol68>BEGIN # find some Quad power prime seeds, numbers n such that: # |
<lang algol68>BEGIN # find some Quad power prime seeds, numbers n such that: # |