[Haskell] Can anyone help me with partition numbers?

whoals (sent by Nabble.com) lists at nabble.com
Thu Nov 24 10:59:50 EST 2005

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 forum at Nabble.com:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org//pipermail/haskell/attachments/20051124/4cb90bfa/attachment.htm

More information about the Haskell mailing list