Rewrite Integer as Sum
Decompose any positive integer into a sum of smaller integers. Generate all mathematical partitions or specify custom addend constraints.
What Is an Integer Partition?
In number theory and combinatorics, an integer partition is a way of writing a positive integer $N$ as a sum of positive integers. For example, the number 4 can be partitioned in five distinct ways:
4 = 4
4 = 3 + 1
4 = 2 + 2
4 = 2 + 1 + 1
4 = 1 + 1 + 1 + 1
Symmetry and Constraints in Sum Decomposition
Our calculator allows you to apply strict constraints to your partitions, filtering the combinations to suit your specific mathematical needs:
- Exact Number of Terms: Restricts the decomposition to contain exactly $k$ addends. For instance, decomposing
10into exactly 3 terms. - Distinct Addends Only: Ensures that all terms in each sum are unique (no repeated numbers). E.g.
4 = 3 + 1is valid, but4 = 2 + 2is excluded. - Parity Control (Odd/Even): Limit terms to contain only odd integers or only even integers.
- Maximum Value Limits: Specify the maximum value any individual term can have.
Frequently Asked Questions
What is the order of terms in the output?
Partitions are standardly listed in non-increasing order (where terms are sorted from largest to smallest, e.g. 3 + 2 + 1). This prevents duplicate combinations with different permutations from appearing in the output.
Why is the input integer limited to 80?
The number of integer partitions grows extremely fast as the number increases (e.g. N=100 has over 190 million partitions!). To prevent browser lag or crashes, a safe local calculation ceiling is set.
Can I include zero in the sums?
Yes! By checking the "Allow Zero" box, the tool will include zero in the term lists (e.g., 5 = 3 + 2 + 0). To prevent infinite loops, only a single zero is allowed per partition.
Related tools
Your recent visits