Primes: n*2^m+1: Difference between revisions

(Added Perl)
Line 17:
 
=={{header|ALGOL 68}}==
{{works with|ALGOL 68G|Any2 or 3 - testedTested with release 3.0.3 under Windows}}
{{libheader|ALGOL 68-primes}}
Attempts the stretchier stretch goal - with 2000 digit precision and restricting m to at most 600, all of the first 400 primes can be found, except for 383. Increasing the number of digits and max n to 8000 should find prime 383, however I couldn't be bothered to wait long enough...<br>
The values of the primes are interesting - most will fit in 64 bits apart but there are a small number that have hundreds or thousands of digits. <br>
<b>NB</b> the primes.incl.a68 source is available on a page in Rosetta Code - see the <b>library</b> above.
<syntaxhighlight lang="algol68">
BEGIN # find primes of the form 1+n*2^m where m is the lowest integer >= 0 #
3,028

edits