Calmo numbers: Difference between revisions

Add Factor
(Added Quackery.)
(Add Factor)
Line 478:
Elapsed Time: 11.747 ms.
 
</pre>
 
=={{header|Factor}}==
<syntaxhighlight lang="factor">USING: combinators.short-circuit grouping.extras kernel math
math.functions math.primes math.primes.factors math.vectors
prettyprint ranges sequences sequences.extras ;
IN: calmo
 
: calmo? ( n -- ? )
divisors 1 -1 rot subseq* {
[ empty? not ]
[ length 3 divisor? ]
[ [ + + prime? ] 3 group-map vall? ]
} 1&& ;
 
MAIN: [ 2 1000 [a..b) [ calmo? ] filter . ]</syntaxhighlight>
{{out}}
<pre>
V{ 165 273 385 399 561 595 665 715 957 }
</pre>
 
1,827

edits