
24 Nov
2005
24 Nov
'05
4 p.m.
A partition of a positive integer n is a representation of n as the sum of any number of positive integral parts. For example, there are 7 partitions of the number 5: 1+1+1+1+1, 1+1+1+2, 1+1+3, 1+2+2, 1+4, 2+3 and 5. Define a function parts which returns the list of distinct partitions of an integer n. For example, parts 4 = [[1,1,1,1],[1,1,2],[1,3],[2,2],[4]]. -- Sent from the Haskell - Haskell-Cafe forum at Nabble.com: http://www.nabble.com/Can-anyone-help-me-with-partition-numbers--t612336.htm...