What Is the Number of Partitions with Distinct Parts?
Wondering why what Is the Number of Partitions with Distinct Parts impacts your daily choices? Read our breakdown and key takeaways.
Input: n = 2 Output: 2 1 1 Input: n = 3 Output: 3 2 1 1 1 1 Note: 2+1 and 1+2 are considered as duplicates. Input: n = 4 Output: 4 3 1 2 2 2 1 1 1 1 1 1 Recommended: Please solve it on “ PRACTICE ” first, before moving on to the solution.
What are the Partitions of n into k parts?
Now consider the partitions of n into k parts. Some of these partitions contain no 1s, like 3+ 3+4+ 6, a partition of 16 into 4 parts. Subtracting 1 from each part, we get a partition of n− k into k parts; for the example, this is 2 +2+ 3+5. The remaining partitions of n into k parts contain a 1.