Least m such that n! + m is prime: Difference between revisions

m
m (→‎{{header|Raku}}: twiddles)
Line 36:
my @least-m = lazy (^∞).hyper(:2batch).map: {(1..*).first: -> \n {(@f[$_] + n).is-prime}};
 
say "Least positive m such that n! + m is prime; first fifty:\n"
~ @least-m[^50].batch(10)».fmt("%3d").join: "\n";
 
Line 44:
}</syntaxhighlight>
{{out}}
<pre>Least positive m such that n! + m is prime; first fifty:
1 1 1 1 5 7 7 11 23 17
11 1 29 67 19 43 23 31 37 89
10,333

edits