Integer Partition Calculator
Integer Partition Calculator
An integer partition writes a whole number as a sum of positive integers where order doesn't matter — 4+1 and 1+4 count as exactly the same partition, unlike an ordered sum, which would treat them as different. Enter any whole number, and this calculator finds exactly how many distinct partitions it has. The count grows quickly but far more gently than factorial-based sequences: the number 5 has 7 partitions, 10 has 42, and 20 already has 627.
- An integer partition writes a number as a sum of positive integers where order doesn't matter, so 4+1 and 1+4 count as the same partition, unlike an ordered sum (composition).
- This is different from counting compositions, which do care about order, partitions are always about "what numbers add up to n," regardless of arrangement.
- The partition function p(n) grows quickly but far more slowly than factorial-based sequences: p(5) = 7, p(10) = 42, p(20) = 627, and so on.
How is an integer partition different from a composition?
A partition ignores order — 3+2 and 2+3 are the same partition — while a composition treats them as different arrangements.
How many partitions does the number 5 have?
7: 5, 4+1, 3+2, 3+1+1, 2+2+1, 2+1+1+1, and 1+1+1+1+1.
Integer Partition Calculator


An integer partition writes a whole number as a sum of positive integers where order doesn't matter — 4+1 and 1+4 count as exactly the same partition, unlike an ordered sum, which would treat them as different. Enter any whole number, and this calculator finds exactly how many distinct partitions it has. The count grows quickly but far more gently than factorial-based sequences: the number 5 has 7 partitions, 10 has 42, and 20 already has 627.

- An integer partition writes a number as a sum of positive integers where order doesn't matter, so 4+1 and 1+4 count as the same partition, unlike an ordered sum (composition).
- This is different from counting compositions, which do care about order, partitions are always about "what numbers add up to n," regardless of arrangement.
- The partition function p(n) grows quickly but far more slowly than factorial-based sequences: p(5) = 7, p(10) = 42, p(20) = 627, and so on.
How is an integer partition different from a composition?
A partition ignores order — 3+2 and 2+3 are the same partition — while a composition treats them as different arrangements.
How many partitions does the number 5 have?
7: 5, 4+1, 3+2, 3+1+1, 2+2+1, 2+1+1+1, and 1+1+1+1+1.
