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

m
(New draft task and Raku example)
 
Line 17:
 
=={{header|Raku}}==
First 383382 in less than a second. 383 pushes the total accumulated time over 25 seconds.
<syntaxhighlight lang="raku" line>-> $n { (^∞).map: -> $m { if (my $p = $n × 2 ** $m + 1).is-prime { say "$n: $p"; last } } } for 1..400</syntaxhighlight>
{{out}}
10,327

edits