Partition an integer x into n primes: Difference between revisions
m
→{{header|Haskell}}: Tidying
(Added Rust Solution) |
m (→{{header|Haskell}}: Tidying) |
||
Line 754:
=={{header|Haskell}}==
<lang haskell>import Data.
import Data.Numbers.Primes (primes)
import Data.
-------------------- PRIME PARTITIONS ---------------------
Line 785:
[ justifyLeft 9 ' ' (show (x, n))
, let xs = partitions x n
in bool
(tail $ concatMap (('+' :) . show) xs)
"(no solution)"
(null xs)
]) <$>
concat
|