In number theory, a partition of a positive integer n is a way of writing n as a sum of positive integers. Two sums that differ only in the order of their summands are considered to be the same partition; if order matters then the sum becomes a composition. The number of partitions of n is given by the partition function p(n). You can compute p(n) recursively. See http://en.wikipedia.org/wiki/Partition_(number_theory).
Dave On Jun 6, 2:05 pm, Raj N <[email protected]> wrote: > How do you count the number of ways a number can be expressed as a sum > of 2 or more numbers? > For eg. if the number is 5 , count=3 i.e 1+1+1+1+1, 4+1, 3+2 > note 2+3 is same as 3+2 -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
