RosettaCodeData/Task/Semiprime/Factor/semiprime-1.factor

6 lines
169 B
Factor
Raw Permalink Normal View History

2018-06-22 20:57:24 +00:00
USING: kernel math.combinatorics math.primes.factors sequences ;
2020-02-17 23:21:07 -08:00
2018-06-22 20:57:24 +00:00
: semiprime? ( n -- ? )
[ factors 2 <combinations> [ product ] map ]
[ [ = ] curry ] bi any? ;