Partition an integer x into n primes: Difference between revisions

m
m (→‎{{header|Haskell}}: (minor reductions – fractionally faster))
Line 613:
 
-------------------- PRIME PARTITIONS ---------------------
partitionpartitions :: Int -> Int -> [Int]
partitionpartitions x n
| n <= 1 =
[ x
Line 638:
" -> "
[ justifyLeft 9 ' ' (show (x, n))
, let xs = partitionpartitions x n
in bool (intercalate "+" (show <$> xs)) "(no solution)" (null xs)
]) <$>
9,659

edits