Ultra useful primes: Difference between revisions

Add Factor
m (→‎{{header|Perl}}: forgot pragma)
(Add Factor)
Line 21:
 
=={{header|Factor}}==
{{works with|Factor|0.99 2021-06-02}}
<lang factor>USING: io kernel lists lists.lazy math math.primes prettyprint ;
 
: useful ( -- list )
1 lfrom [ 2^ 2^ ] lmap-lazy
[ 1 lfrom [ - prime? ] with lfilter car ] lmap-lazy ;
 
10 useful ltake [ pprint bl ] leach nl</lang>
{{out}}
<pre>
1 3 5 15 5 59 159 189 569 105
</pre>
 
=={{header|Perl}}==
1,808

edits